mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
Cleanup and prepping for bed presence
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ backup_config.yaml
|
||||
.storage/
|
||||
.cloud/
|
||||
.automatic/
|
||||
.tts.token
|
||||
.tts.token*
|
||||
customize.yaml
|
||||
image/
|
||||
open-zwave/
|
||||
|
||||
@@ -105,8 +105,8 @@ action:
|
||||
target:
|
||||
entity_id: media_player.downstairs_roku
|
||||
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: switch.shelly_projector
|
||||
# - service: homeassistant.turn_off
|
||||
# entity_id: switch.shelly_projector
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
|
||||
@@ -68,7 +68,7 @@ action:
|
||||
- media_player.all_speakers
|
||||
- media_player.front_room_tv
|
||||
- media_player.downstairs_roku
|
||||
- switch.shelly_projector
|
||||
#- switch.shelly_projector
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
|
||||
@@ -15,17 +15,17 @@ trigger:
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- id: projector_off
|
||||
platform: state
|
||||
entity_id: switch.shelly_projector
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
# - id: projector_off
|
||||
# platform: state
|
||||
# entity_id: switch.shelly_projector
|
||||
# from: 'on'
|
||||
# to: 'off'
|
||||
|
||||
- id: projector_on
|
||||
platform: state
|
||||
entity_id: switch.shelly_projector
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
# - id: projector_on
|
||||
# platform: state
|
||||
# entity_id: switch.shelly_projector
|
||||
# from: 'off'
|
||||
# to: 'on'
|
||||
|
||||
- id: setting_change
|
||||
platform: state
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,225 +0,0 @@
|
||||
blueprint:
|
||||
name: Frigate Notification
|
||||
description: "## Frigate Mobile App Notification\n\nThis blueprint will send a notification\
|
||||
\ to your device when a Frigate event for the selected camera is fired. The notification\
|
||||
\ will initially include the thumbnail of the detection, but will update to include\
|
||||
\ actionable notifications allowing you to view the saved clip/snapshot when available,\
|
||||
\ or silence the notification for a configurable amount of time.\n\nWith this\
|
||||
\ blueprint, you may send the notification to multiple devices by leaving \"Device\"\
|
||||
\ blank and instead use a [notification group][1].\n\n### Required entities:\n\
|
||||
\ - Frigate Camera Name\n - Mobile App Device **or** the name of a Notification\
|
||||
\ Group\n\n### Optional features:\n - You can limit notifications to objects\
|
||||
\ entering **any** pre-defined [zones][2] in Frigate.\n - You can specify which\
|
||||
\ [zones][2] to be notified about. This must be a list (e.g.):\n ```yaml\n\
|
||||
\ - backyard\n ```\n - You can specify what type of [objects][3] to be\
|
||||
\ notified about. This must be a list (e.g.):\n ```yaml\n - person\n \
|
||||
\ - car\n ```\n - You can disable notifications if a presence entity or group\
|
||||
\ is \"home\".\n - You can configure a cooldown for the camera to reduce the\
|
||||
\ number of notifications when back-to-back events occur.\n - You can silence\
|
||||
\ future notifications for a defined amount of time through actionable notifications.\
|
||||
\ This is helpful in situations where you know you will be triggering detections\
|
||||
\ for an extended period of time, like when the kids are playing outside.\n\n\
|
||||
[1]: https://companion.home-assistant.io/docs/notifications/notifications-basic#sending-notifications-to-multiple-devices\n\
|
||||
[2]: https://blakeblackshear.github.io/frigate/configuration/cameras#zones\n[3]:\
|
||||
\ https://blakeblackshear.github.io/frigate/configuration/objects\n"
|
||||
domain: automation
|
||||
source_url: https://gist.github.com/hunterjm/23c1588a9f2b8b9c2a62ffc364e17f8c
|
||||
input:
|
||||
camera:
|
||||
name: Frigate Camera
|
||||
description: The name of the camera as defined in your frigate configuration.
|
||||
notify_device:
|
||||
name: Device
|
||||
description: The device must run the official Home Assistant app to receive
|
||||
notifications.
|
||||
default: false
|
||||
selector:
|
||||
device:
|
||||
integration: mobile_app
|
||||
notify_group:
|
||||
name: Notification Group
|
||||
description: The name of the notification group to call.
|
||||
default: ''
|
||||
base_url:
|
||||
name: (Optional) Base URL
|
||||
description: 'The external url for your Home Assistant instance. This will default
|
||||
to a relative URL and will open the clips in the app instead of the browser,
|
||||
which may cause issues on some devices.
|
||||
|
||||
'
|
||||
default: ''
|
||||
zone_filter:
|
||||
name: (Optional) Zone Filter
|
||||
description: Only notify if object has entered a defined zone.
|
||||
default: false
|
||||
selector:
|
||||
boolean: {}
|
||||
zones:
|
||||
name: (Optional) Trigger Zones
|
||||
description: A list (-) of zones you wish to recieve notifications for.
|
||||
default: []
|
||||
selector:
|
||||
object: {}
|
||||
labels:
|
||||
name: (Optional) Trigger Objects
|
||||
description: A list (-) of objects you wish to recieve notifications for.
|
||||
default: []
|
||||
selector:
|
||||
object: {}
|
||||
presence_filter:
|
||||
name: (Optional) Presence Filter
|
||||
description: Only notify if selected presence entity is not "home".
|
||||
default: ''
|
||||
selector:
|
||||
entity: {}
|
||||
cooldown:
|
||||
name: (Optional) Cooldown
|
||||
description: Delay before sending another notification for this camera after
|
||||
the last event.
|
||||
default: 30
|
||||
selector:
|
||||
number:
|
||||
max: 300.0
|
||||
min: 0.0
|
||||
unit_of_measurement: seconds
|
||||
step: 1.0
|
||||
mode: slider
|
||||
silence_timer:
|
||||
name: (Optional) Silence Notifications
|
||||
description: 'How long to silence notifications for this camera when requested
|
||||
as part of the actionable notification.
|
||||
|
||||
'
|
||||
default: 30
|
||||
selector:
|
||||
number:
|
||||
max: 300.0
|
||||
min: 0.0
|
||||
unit_of_measurement: minutes
|
||||
step: 1.0
|
||||
mode: slider
|
||||
mode: single
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: !input 'camera'
|
||||
value_template: '{{ value_json[''after''][''camera''] }}'
|
||||
variables:
|
||||
id: '{{ trigger.payload_json[''after''][''id''] }}'
|
||||
camera: '{{ trigger.payload_json[''after''][''camera''] }}'
|
||||
camera_name: '{{ camera | replace(''_'', '' '') | title }}'
|
||||
object: '{{ trigger.payload_json[''after''][''label''] }}'
|
||||
label: '{{ object | title }}'
|
||||
entered_zones: '{{ trigger.payload_json[''after''][''entered_zones''] }}'
|
||||
type: '{{ trigger.payload_json[''type''] }}'
|
||||
base_url: !input 'base_url'
|
||||
group_target: !input 'notify_group'
|
||||
zone_only: !input 'zone_filter'
|
||||
input_zones: !input 'zones'
|
||||
zones: '{{ input_zones | list }}'
|
||||
input_labels: !input 'labels'
|
||||
labels: '{{ input_labels | list }}'
|
||||
presence_entity: !input 'presence_filter'
|
||||
condition:
|
||||
- '{{ type != ''end'' }}'
|
||||
- '{{ not zone_only or entered_zones|length > 0 }}'
|
||||
- '{{ not zones|length or zones|select(''in'', entered_zones)|list|length > 0 }}'
|
||||
- '{{ not labels|length or object in labels }}'
|
||||
- '{{ not presence_entity or not is_state(presence_entity, ''home'') }}'
|
||||
action:
|
||||
- choose:
|
||||
- conditions: '{{ not group_target }}'
|
||||
sequence:
|
||||
- device_id: !input 'notify_device'
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: '{{ id }}'
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: '{{ id }}'
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
- repeat:
|
||||
sequence:
|
||||
- wait_for_trigger:
|
||||
- platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: '{{ id }}'
|
||||
value_template: '{{ value_json[''after''][''id''] }}'
|
||||
timeout:
|
||||
minutes: 2
|
||||
continue_on_timeout: false
|
||||
- condition: template
|
||||
value_template: '{{ wait.trigger.payload_json[''type''] == ''end'' }}'
|
||||
- choose:
|
||||
- conditions: '{{ not group_target }}'
|
||||
sequence:
|
||||
- device_id: !input 'notify_device'
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: '{{ id }}'
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4'
|
||||
clickAction: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4'
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4'
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: '{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg'
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: '{{ id }}'
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4'
|
||||
clickAction: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4'
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4'
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: '{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg'
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
until: '{{ wait.trigger.payload_json[''type''] == ''end'' }}'
|
||||
- wait_for_trigger:
|
||||
- platform: event
|
||||
event_type: mobile_app_notification_action
|
||||
event_data:
|
||||
action: silence-{{ camera }}
|
||||
timeout:
|
||||
seconds: !input 'cooldown'
|
||||
continue_on_timeout: false
|
||||
- delay:
|
||||
minutes: !input 'silence_timer'
|
||||
@@ -329,6 +329,11 @@ google_assistant:
|
||||
aliases:
|
||||
- Master Bedroom Awake
|
||||
|
||||
input_boolean.master_bed_occupied:
|
||||
name: Master Bed Occupied
|
||||
room: Master Bedroom
|
||||
expose: true
|
||||
|
||||
input_button.blue_room_bedtime:
|
||||
name: Teens Bedtime
|
||||
room: Blue Room
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
substitutions:
|
||||
sensor_gpio_left: GPIO10
|
||||
sensor_gpio_right: GPIO20
|
||||
|
||||
packages:
|
||||
diagnostics: !include
|
||||
file: ../esphome-common/diagnostics.yaml
|
||||
vars:
|
||||
boot_gpio: GPIO9
|
||||
uptime_id: bed_presence_uptime
|
||||
restart_id: btn_restart
|
||||
status_id: bed_presence_status
|
||||
|
||||
left_bed_sensor: !include
|
||||
file: sensor.yaml
|
||||
vars:
|
||||
sensor_name: Left
|
||||
sensor_id: left
|
||||
sensor_gpio: ${sensor_gpio_left}
|
||||
|
||||
right_bed_sensor: !include
|
||||
file: sensor.yaml
|
||||
vars:
|
||||
sensor_name: Right
|
||||
sensor_id: right
|
||||
sensor_gpio: ${sensor_gpio_right}
|
||||
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
name: Bed Occupied Both (Fast)
|
||||
id: bed_occupied_both_fast
|
||||
device_class: occupancy
|
||||
icon: mdi:bunk-bed
|
||||
disabled_by_default: true
|
||||
lambda: return id(bed_occupied_left_fast).state && id(bed_occupied_right_fast).state;
|
||||
|
||||
- platform: template
|
||||
name: Bed Occupied Either (Fast)
|
||||
id: bed_occupied_either_fast
|
||||
device_class: occupancy
|
||||
icon: mdi:bunk-bed
|
||||
disabled_by_default: true
|
||||
lambda: return id(bed_occupied_left_fast).state || id(bed_occupied_right_fast).state;
|
||||
|
||||
- platform: template
|
||||
name: Bed Occupied Both
|
||||
id: bed_occupied_both
|
||||
device_class: occupancy
|
||||
icon: mdi:bunk-bed
|
||||
lambda: return id(bed_occupied_left).state && id(bed_occupied_right).state;
|
||||
|
||||
- platform: template
|
||||
name: Bed Occupied Either
|
||||
id: bed_occupied_either
|
||||
device_class: occupancy
|
||||
icon: mdi:bunk-bed
|
||||
lambda: return id(bed_occupied_left).state || id(bed_occupied_right).state;
|
||||
|
||||
switch:
|
||||
- platform: template
|
||||
name: Full Range
|
||||
id: full_range
|
||||
optimistic: true
|
||||
restore_mode: RESTORE_DEFAULT_OFF
|
||||
entity_category: config
|
||||
icon: mdi:arrow-expand
|
||||
|
||||
select:
|
||||
- platform: template
|
||||
name: "Response Speed"
|
||||
id: response_speed
|
||||
icon: mdi:speedometer
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
options:
|
||||
- "Fast"
|
||||
- "Normal"
|
||||
- "Slow"
|
||||
initial_option: "Normal"
|
||||
entity_category: config
|
||||
@@ -0,0 +1,15 @@
|
||||
api:
|
||||
on_client_connected:
|
||||
- esp32_ble_tracker.start_scan:
|
||||
continuous: true
|
||||
on_client_disconnected:
|
||||
- esp32_ble_tracker.stop_scan:
|
||||
|
||||
bluetooth_proxy:
|
||||
active: true
|
||||
|
||||
esp32_ble_tracker:
|
||||
id: ble_tracker
|
||||
scan_parameters:
|
||||
active: true
|
||||
continuous: false
|
||||
@@ -0,0 +1,59 @@
|
||||
substitutions:
|
||||
boot_gpio: GPIO9
|
||||
boot_id: boot_button
|
||||
status_id: status_sensor
|
||||
factory_reset_id: factory_reset_button
|
||||
restart_id: restart_button
|
||||
wifi_db_id: wifi_signal_db
|
||||
wifi_percent_id: wifi_signal_percent
|
||||
uptime_id: uptime_sensor
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: ${boot_gpio}
|
||||
mode: INPUT_PULLUP
|
||||
inverted: true
|
||||
id: ${boot_id}
|
||||
internal: true
|
||||
name: Boot Button
|
||||
filters:
|
||||
- delayed_on: 10s
|
||||
on_press:
|
||||
then:
|
||||
- button.press: ${factory_reset_id}
|
||||
|
||||
- platform: status
|
||||
id: ${status_id}
|
||||
name: Status
|
||||
|
||||
button:
|
||||
- platform: factory_reset
|
||||
id: ${factory_reset_id}
|
||||
internal: true
|
||||
|
||||
- platform: restart
|
||||
name: Restart
|
||||
id: ${restart_id}
|
||||
entity_category: diagnostic
|
||||
|
||||
sensor:
|
||||
- platform: wifi_signal # Reports the WiFi signal strength in dB
|
||||
name: WiFi Signal dB
|
||||
id: ${wifi_db_id}
|
||||
update_interval: 60s
|
||||
|
||||
- platform: copy # Reports the WiFi signal strength in %
|
||||
source_id: ${wifi_db_id}
|
||||
name: WiFi Signal Percent
|
||||
id: ${wifi_percent_id}
|
||||
filters:
|
||||
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
|
||||
unit_of_measurement: '%'
|
||||
entity_category: diagnostic
|
||||
device_class: ""
|
||||
|
||||
- platform: uptime
|
||||
type: seconds
|
||||
id: ${uptime_id}
|
||||
name: Uptime
|
||||
@@ -0,0 +1,240 @@
|
||||
substitutions:
|
||||
# Calibrate Trigger Percentile
|
||||
# This controls how the trigger threshold is set during calibration. During calibration, the unoccupied and occupied
|
||||
# pressure values are determined. This is the percentage of the difference between those values required to trigger
|
||||
# the "occupied" state.
|
||||
# - 0.75 Requires 75% of the occupied pressure to trigger (DEFAULT)
|
||||
# - 0.50 Set trigger exactly in the middle of unoccupied and occupied pressures
|
||||
# - 0.25 More sensitive, likely to be triggered by partner
|
||||
trigger_percentile: '0.75'
|
||||
|
||||
# Window Averaging Samples
|
||||
# Add a sliding window moving average to the incoming sensor samples. This specifies the number of samples to average
|
||||
# over. Each sample is 1/2 second.
|
||||
# - 1 Don't perform averaging
|
||||
# - 5 Average over 5 samples (2.5 seconds) (DEFAULT)
|
||||
# - 10 Average over 10 samples (5 seconds)
|
||||
averaging_window_samples: '5'
|
||||
|
||||
# Fast Sensor Delay
|
||||
# This controls how long the "Fast" sensor must register "unoccupied" or "occupied" before reporting. Averaging or
|
||||
# delay is encouraged to prevent frequent false negatives as you shift in bed.
|
||||
# - 2s Same response as standard sensor
|
||||
# - 500ms Good starting point for getting speed without too many false negatives
|
||||
# - 0ms No delay (DEFAULT)
|
||||
fast_delayed_on: '0ms'
|
||||
fast_delayed_off: '0ms'
|
||||
|
||||
# Standard Sensor Delay
|
||||
# This controls how long the standard sensor must register "unoccupied" or "occupied" before reporting. Averaging or
|
||||
# delay is enocuraged to ensure stability.
|
||||
standard_delayed_on: '0s'
|
||||
standard_delayed_off: '1s'
|
||||
|
||||
# Slow Sensor Delay
|
||||
# This controls how long the "Slow" sensor must register "unoccupied" or "occupied" before reporting. Averaging or
|
||||
# delay is encouraged to ensure stability.
|
||||
slow_delayed_on: '2s'
|
||||
slow_delayed_off: '5s'
|
||||
|
||||
# Reporting Delta
|
||||
# The sensor must change by this amount before an update is sent (or the reporting_interval_max has been hit)
|
||||
# - 10.0 Only report very large changes
|
||||
# - 1.0 Relatively sensitive with much less reporting (DEFAULT)
|
||||
# - 0.1 Very sensitive, will report frequently
|
||||
reporting_delta: '1.0'
|
||||
|
||||
# Reporting Interval (Max)
|
||||
# The max amount of time between sensor reports (even if the value hasn't changed)
|
||||
reporting_interval_max: '180s'
|
||||
|
||||
# Linear Calibration Points
|
||||
# Change the linear calibration points for the FSR sensor. These values correspond with the raw pulses per minute from
|
||||
# the pulse_counter. Only mess with this if you know what you're doing. In standard mode (Full Range = False), the
|
||||
# sensor is linearly calibrated between calibrate_0 (0%) and calibreate_100 (100%). When Full Range = True,
|
||||
# calibrate_0 is set to 0.
|
||||
calibrate_100: '408000'
|
||||
calibrate_0: '276000'
|
||||
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
name: Bed Occupied ${sensor_name} (Fast)
|
||||
id: bed_occupied_${sensor_id}_fast
|
||||
device_class: occupancy
|
||||
icon: mdi:speedometer
|
||||
disabled_by_default: true
|
||||
filters:
|
||||
- delayed_on: ${fast_delayed_on}
|
||||
- delayed_off: ${fast_delayed_off}
|
||||
lambda: return id(bed_sensor_${sensor_id}).state > id(val_trigger_${sensor_id}).state;
|
||||
|
||||
- platform: template
|
||||
name: Bed Occupied ${sensor_name} (Normal)
|
||||
id: bed_occupied_${sensor_id}_normal
|
||||
device_class: occupancy
|
||||
icon: mdi:speedometer-medium
|
||||
disabled_by_default: true
|
||||
filters:
|
||||
- delayed_on: ${standard_delayed_on}
|
||||
- delayed_off: ${standard_delayed_off}
|
||||
lambda: return id(bed_sensor_${sensor_id}).state > id(val_trigger_${sensor_id}).state;
|
||||
|
||||
- platform: template
|
||||
id: bed_occupied_${sensor_id}_slow
|
||||
name: Bed Occupied ${sensor_name} (Slow)
|
||||
device_class: occupancy
|
||||
icon: mdi:speedometer-slow
|
||||
disabled_by_default: true
|
||||
filters:
|
||||
- delayed_on: ${slow_delayed_on}
|
||||
- delayed_off: ${slow_delayed_off}
|
||||
lambda: return id(bed_sensor_${sensor_id}).state > id(val_trigger_${sensor_id}).state;
|
||||
|
||||
- platform: template
|
||||
name: Bed Occupied ${sensor_name}
|
||||
id: bed_occupied_${sensor_id}
|
||||
device_class: occupancy
|
||||
icon: mdi:bed
|
||||
lambda: |- # Sensor response is user tunable via "Response Speed"
|
||||
if (id(response_speed).state == "Fast") {
|
||||
return id(bed_occupied_${sensor_id}_fast).state;
|
||||
} else if (id(response_speed).state == "Slow") {
|
||||
return id(bed_occupied_${sensor_id}_slow).state;
|
||||
} else {
|
||||
return id(bed_occupied_${sensor_id}_normal).state;
|
||||
}
|
||||
|
||||
sensor:
|
||||
- platform: pulse_counter
|
||||
pin: ${sensor_gpio}
|
||||
name: ${sensor_name} Pressure
|
||||
id: bed_sensor_${sensor_id}
|
||||
update_interval: 0.5s
|
||||
unit_of_measurement: '%'
|
||||
icon: mdi:gauge
|
||||
filters:
|
||||
- lambda: |- # scale pulses/minute to 0%->100%
|
||||
float cal_0 = id(full_range).state ? 0 : ${calibrate_0};
|
||||
|
||||
float val = (x - cal_0) * 100;
|
||||
float range = ${calibrate_100} - cal_0;
|
||||
|
||||
return val/range;
|
||||
- clamp:
|
||||
min_value: 0
|
||||
- sliding_window_moving_average:
|
||||
window_size: ${averaging_window_samples}
|
||||
send_every: 1
|
||||
- or:
|
||||
- delta: ${reporting_delta} # only send if sensor changes by `reporting_delta` (eliminate sensor noise)
|
||||
- throttle: ${reporting_interval_max} # but still update every `reporting_interval_max`
|
||||
- platform: copy
|
||||
source_id: bed_sensor_${sensor_id}
|
||||
name: Calibrated ${sensor_name} Pressure
|
||||
id: bed_sensor_${sensor_id}_calibrated
|
||||
icon: mdi:scale-balance
|
||||
disabled_by_default: true
|
||||
filters:
|
||||
- lambda: |- # scale between val_unoccupied and val_occupied
|
||||
float cal_0 = id(val_unoccupied_${sensor_id}).state;
|
||||
float cal_100 = id(val_occupied_${sensor_id}).state;
|
||||
|
||||
float val = (x - cal_0) * 100;
|
||||
float range = cal_100 - cal_0;
|
||||
|
||||
return val/range;
|
||||
- clamp:
|
||||
max_value: 100
|
||||
min_value: 0
|
||||
|
||||
number:
|
||||
- platform: template
|
||||
name: ${sensor_name} Unoccupied Pressure
|
||||
id: val_unoccupied_${sensor_id}
|
||||
icon: mdi:gauge-empty
|
||||
unit_of_measurement: '%'
|
||||
entity_category: diagnostic
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
initial_value: 0
|
||||
min_value: 0
|
||||
max_value: 120
|
||||
step: 1.0
|
||||
mode: box
|
||||
on_value:
|
||||
then:
|
||||
- lambda: |- # Update trigger
|
||||
id(update_trigger_${sensor_id})->execute();
|
||||
- platform: template
|
||||
name: ${sensor_name} Occupied Pressure
|
||||
id: val_occupied_${sensor_id}
|
||||
icon: mdi:gauge-full
|
||||
unit_of_measurement: '%'
|
||||
entity_category: diagnostic
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
initial_value: 100
|
||||
min_value: 0
|
||||
max_value: 120
|
||||
step: 1.0
|
||||
mode: box
|
||||
on_value:
|
||||
then:
|
||||
- lambda: |- # Update trigger
|
||||
id(update_trigger_${sensor_id})->execute();
|
||||
- platform: template
|
||||
name: ${sensor_name} Trigger Pressure
|
||||
id: val_trigger_${sensor_id}
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
initial_value: 50
|
||||
min_value: 0
|
||||
max_value: 120
|
||||
step: 1.0
|
||||
mode: box
|
||||
icon: mdi:gauge
|
||||
unit_of_measurement: '%'
|
||||
entity_category: config
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: Calibrate ${sensor_name} Unoccupied
|
||||
id: calibration_${sensor_id}_set_unoccupied
|
||||
icon: mdi:bed-empty
|
||||
entity_category: config
|
||||
on_press:
|
||||
then:
|
||||
- number.set:
|
||||
id: val_unoccupied_${sensor_id}
|
||||
# round to 2 decimal places
|
||||
value: !lambda return round(id(bed_sensor_${sensor_id}).state * 100)/100.0;
|
||||
- platform: template
|
||||
name: Calibrate ${sensor_name} Occupied
|
||||
id: calibration_${sensor_id}_set_occupied
|
||||
icon: mdi:bed
|
||||
entity_category: config
|
||||
on_press:
|
||||
then:
|
||||
- number.set:
|
||||
id: val_occupied_${sensor_id}
|
||||
# round to 2 decimal places
|
||||
value: !lambda return round(id(bed_sensor_${sensor_id}).state * 100)/100.0;
|
||||
|
||||
script:
|
||||
- id: update_trigger_${sensor_id}
|
||||
mode: queued
|
||||
then:
|
||||
- lambda: |- # Set trigger to x% of difference between min/max
|
||||
float unoccupied_pressure = id(val_unoccupied_${sensor_id}).state;
|
||||
float occupied_pressure = id(val_occupied_${sensor_id}).state;
|
||||
|
||||
// calculate new trigger value
|
||||
float trigger_pressure = unoccupied_pressure + ((occupied_pressure - unoccupied_pressure) * float(${trigger_percentile}));
|
||||
|
||||
// round to 2 decimal places
|
||||
trigger_pressure = round(trigger_pressure * 100)/100.0;
|
||||
|
||||
// set value
|
||||
auto call = id(val_trigger_${sensor_id}).make_call();
|
||||
call.set_value(trigger_pressure);
|
||||
call.perform();
|
||||
@@ -1,321 +0,0 @@
|
||||
##############################################################################
|
||||
# Globals Glances parameters
|
||||
##############################################################################
|
||||
|
||||
[global]
|
||||
# Does Glances should check if a newer version is available on PyPI ?
|
||||
check_update=false
|
||||
# History size (maximum number of values)
|
||||
# Default glances history size to 0
|
||||
# https://github.com/hassio-addons/addon-glances/issues/61
|
||||
# https://github.com/nicolargo/glances/issues/1341
|
||||
history_size=0
|
||||
|
||||
##############################################################################
|
||||
# User interface
|
||||
##############################################################################
|
||||
|
||||
[outputs]
|
||||
# Theme name for the Curses interface: black or white
|
||||
curse_theme=black
|
||||
# Limit the number of processes to display in the WebUI
|
||||
max_processes_display=30
|
||||
|
||||
##############################################################################
|
||||
# plugins
|
||||
##############################################################################
|
||||
|
||||
[quicklook]
|
||||
# Define CPU, MEM and SWAP thresholds in %
|
||||
cpu_careful=50
|
||||
cpu_warning=70
|
||||
cpu_critical=90
|
||||
mem_careful=50
|
||||
mem_warning=70
|
||||
mem_critical=90
|
||||
swap_careful=50
|
||||
swap_warning=70
|
||||
swap_critical=90
|
||||
|
||||
[cpu]
|
||||
# Default values if not defined: 50/70/90 (except for iowait)
|
||||
user_careful=50
|
||||
user_warning=70
|
||||
user_critical=90
|
||||
#user_log=False
|
||||
#user_critical_action=echo {{user}} {{value}} {{max}} > /tmp/cpu.alert
|
||||
system_careful=50
|
||||
system_warning=70
|
||||
system_critical=90
|
||||
steal_careful=50
|
||||
steal_warning=70
|
||||
steal_critical=90
|
||||
#steal_log=True
|
||||
# I/O wait percentage should be lower than 1/# (Logical CPU cores)
|
||||
# Leave commented to just use the default config (1/#-20% / 1/#-10% / 1/#)
|
||||
#iowait_careful=30
|
||||
#iowait_warning=40
|
||||
#iowait_critical=50
|
||||
# Context switch limit (core / second)
|
||||
# Leave commented to just use the default config (critical is 50000*# (Logical CPU cores)
|
||||
#ctx_switches_careful=10000
|
||||
#ctx_switches_warning=12000
|
||||
#ctx_switches_critical=14000
|
||||
|
||||
[percpu]
|
||||
# Define CPU thresholds in %
|
||||
# Default values if not defined: 50/70/90
|
||||
user_careful=50
|
||||
user_warning=70
|
||||
user_critical=90
|
||||
iowait_careful=50
|
||||
iowait_warning=70
|
||||
iowait_critical=90
|
||||
system_careful=50
|
||||
system_warning=70
|
||||
system_critical=90
|
||||
|
||||
[gpu]
|
||||
# Default processor values if not defined: 50/70/90
|
||||
proc_careful=50
|
||||
proc_warning=70
|
||||
proc_critical=90
|
||||
# Default memory values if not defined: 50/70/90
|
||||
mem_careful=50
|
||||
mem_warning=70
|
||||
mem_critical=90
|
||||
|
||||
[mem]
|
||||
# Define RAM thresholds in %
|
||||
# Default values if not defined: 50/70/90
|
||||
careful=50
|
||||
#careful_action_repeat=echo {{percent}} >> /tmp/memory.alert
|
||||
warning=70
|
||||
critical=90
|
||||
|
||||
[memswap]
|
||||
# Define SWAP thresholds in %
|
||||
# Default values if not defined: 50/70/90
|
||||
careful=50
|
||||
warning=70
|
||||
critical=90
|
||||
|
||||
[load]
|
||||
# Define LOAD thresholds
|
||||
# Value * number of cores
|
||||
# Default values if not defined: 0.7/1.0/5.0 per number of cores
|
||||
# Source: http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages
|
||||
# http://www.linuxjournal.com/article/9001
|
||||
careful=0.7
|
||||
warning=1.0
|
||||
critical=5.0
|
||||
#log=False
|
||||
|
||||
[network]
|
||||
# Default bitrate thresholds in % of the network interface speed
|
||||
# Default values if not defined: 70/80/90
|
||||
rx_careful=70
|
||||
rx_warning=80
|
||||
rx_critical=90
|
||||
tx_careful=70
|
||||
tx_warning=80
|
||||
tx_critical=90
|
||||
# Define the list of hidden network interfaces (comma-separated regexp)
|
||||
#hide=docker.*,lo
|
||||
# WLAN 0 alias
|
||||
#wlan0_alias=Wireless IF
|
||||
# It is possible to overwrite the bitrate thresholds per interface
|
||||
# WLAN 0 Default limits (in bits per second aka bps) for interface bitrate
|
||||
#wlan0_rx_careful=4000000
|
||||
#wlan0_rx_warning=5000000
|
||||
#wlan0_rx_critical=6000000
|
||||
#wlan0_rx_log=True
|
||||
#wlan0_tx_careful=700000
|
||||
#wlan0_tx_warning=900000
|
||||
#wlan0_tx_critical=1000000
|
||||
#wlan0_tx_log=True
|
||||
|
||||
[wifi]
|
||||
# Define the list of hidden wireless network interfaces (comma-separated regexp)
|
||||
hide=lo,docker.*
|
||||
# Define SIGNAL thresholds in db (lower is better...)
|
||||
# Based on: http://serverfault.com/questions/501025/industry-standard-for-minimum-wifi-signal-strength
|
||||
careful=-65
|
||||
warning=-75
|
||||
critical=-85
|
||||
|
||||
[diskio]
|
||||
# Define the list of hidden disks (comma-separated regexp)
|
||||
#hide=sda2,sda5,loop.*
|
||||
hide=loop.*
|
||||
# Alias for sda1
|
||||
#sda1_alias=IntDisk
|
||||
|
||||
[fs]
|
||||
# Define the list of hidden file system (comma-separated regexp)
|
||||
#hide=/boot.*
|
||||
# Define filesystem space thresholds in %
|
||||
# Default values if not defined: 50/70/90
|
||||
# It is also possible to define per mount point value
|
||||
# Example: /_careful=40
|
||||
careful=50
|
||||
warning=70
|
||||
critical=90
|
||||
# Allow additional file system types (comma-separated FS type)
|
||||
#allow=zfs
|
||||
|
||||
[folders]
|
||||
# Define a folder list to monitor
|
||||
# The list is composed of items (list_#nb <= 10)
|
||||
# An item is defined by:
|
||||
# * path: absolute path
|
||||
# * careful: optional careful threshold (in MB)
|
||||
# * warning: optional warning threshold (in MB)
|
||||
# * critical: optional critical threshold (in MB)
|
||||
folder_1_path=/config
|
||||
folder_1_careful=4096
|
||||
folder_1_warning=8196
|
||||
folder_1_critical=12228
|
||||
folder_2_path=/share
|
||||
folder_2_careful=4096
|
||||
folder_2_warning=8196
|
||||
folder_2_critical=12228
|
||||
folder_3_path=/backup
|
||||
folder_3_careful=4096
|
||||
folder_3_warning=8196
|
||||
folder_3_critical=12228
|
||||
folder_4_path=/media
|
||||
folder_4_careful=4096
|
||||
folder_4_warning=8196
|
||||
folder_4_critical=12228
|
||||
|
||||
[sensors]
|
||||
# Sensors core thresholds (in Celsius...)
|
||||
# Default values if not defined: 60/70/80
|
||||
temperature_core_careful=60
|
||||
temperature_core_warning=70
|
||||
temperature_core_critical=80
|
||||
# Temperatures threshold in °C for hddtemp
|
||||
# Default values if not defined: 45/52/60
|
||||
temperature_hdd_careful=45
|
||||
temperature_hdd_warning=52
|
||||
temperature_hdd_critical=60
|
||||
# Battery threshold in %
|
||||
battery_careful=80
|
||||
battery_warning=90
|
||||
battery_critical=95
|
||||
# Sensors alias
|
||||
#temp1_alias=Motherboard 0
|
||||
#temp2_alias=Motherboard 1
|
||||
#core 0_alias=CPU Core 0
|
||||
#core 1_alias=CPU Core 1
|
||||
|
||||
[processlist]
|
||||
# Define CPU/MEM (per process) thresholds in %
|
||||
# Default values if not defined: 50/70/90
|
||||
cpu_careful=50
|
||||
cpu_warning=70
|
||||
cpu_critical=90
|
||||
mem_careful=50
|
||||
mem_warning=70
|
||||
mem_critical=90
|
||||
#
|
||||
# Nice priorities range from -20 to 19.
|
||||
# Configure nice levels using a comma separated list.
|
||||
#
|
||||
# Nice: Example 1, non-zero is warning (default behavior)
|
||||
nice_warning=-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
|
||||
#
|
||||
# Nice: Example 2, low priority processes escalate from careful to critical
|
||||
#nice_careful=1,2,3,4,5,6,7,8,9
|
||||
#nice_warning=10,11,12,13,14
|
||||
#nice_critical=15,16,17,18,19
|
||||
|
||||
[ports]
|
||||
# Ports scanner plugin configuration
|
||||
# Interval in second between two scans
|
||||
refresh=30
|
||||
# Set the default timeout (in second) for a scan (can be overwritten in the scan list)
|
||||
timeout=3
|
||||
# If port_default_gateway is True, add the default gateway on top of the scan list
|
||||
port_default_gateway=True
|
||||
#
|
||||
# Define the scan list (1 < x < 255)
|
||||
# port_x_host (name or IP) is mandatory
|
||||
# port_x_port (TCP port number) is optional (if not set, use ICMP)
|
||||
# port_x_description is optional (if not set, define to host:port)
|
||||
# port_x_timeout is optional and overwrite the default timeout value
|
||||
# port_x_rtt_warning is optional and defines the warning threshold in ms
|
||||
#
|
||||
#port_1_host=192.168.0.1
|
||||
#port_1_port=80
|
||||
#port_1_description=Home Box
|
||||
#port_1_timeout=1
|
||||
#port_2_host=www.free.fr
|
||||
#port_2_description=My ISP
|
||||
#port_3_host=www.google.com
|
||||
#port_3_description=Internet ICMP
|
||||
#port_3_rtt_warning=1000
|
||||
#port_4_description=Internet Web
|
||||
#port_4_host=www.google.com
|
||||
#port_4_port=80
|
||||
#port_4_rtt_warning=1000
|
||||
#
|
||||
# Define Web (URL) monitoring list (1 < x < 255)
|
||||
# web_x_url is the URL to monitor (example: http://my.site.com/folder)
|
||||
# web_x_description is optional (if not set, define to URL)
|
||||
# web_x_timeout is optional and overwrite the default timeout value
|
||||
# web_x_rtt_warning is optional and defines the warning respond time in ms (approximatively)
|
||||
#
|
||||
#web_1_url=https://blog.nicolargo.com
|
||||
#web_1_description=My Blog
|
||||
#web_1_rtt_warning=3000
|
||||
#web_2_url=https://github.com
|
||||
#web_3_url=http://www.google.fr
|
||||
#web_3_description=Google Fr
|
||||
#web_4_url=https://blog.nicolargo.com/nonexist
|
||||
#web_4_description=Intranet
|
||||
|
||||
[docker]
|
||||
# Thresholds for CPU and MEM (in %)
|
||||
cpu_careful=50
|
||||
cpu_warning=70
|
||||
cpu_critical=90
|
||||
mem_careful=20
|
||||
mem_warning=50
|
||||
mem_critical=70
|
||||
#
|
||||
# Per container thresholds
|
||||
#containername_cpu_careful=10
|
||||
#containername_cpu_warning=20
|
||||
#containername_cpu_critical=30
|
||||
#
|
||||
# By default, Glances only display running containers
|
||||
# Set the following key to True to display all containers
|
||||
all=False
|
||||
|
||||
##############################################################################
|
||||
# Client/server
|
||||
##############################################################################
|
||||
|
||||
[serverlist]
|
||||
# Define the static servers list
|
||||
#server_1_name=localhost
|
||||
#server_1_alias=My local PC
|
||||
#server_1_port=61209
|
||||
#server_2_name=localhost
|
||||
#server_2_port=61235
|
||||
#server_3_name=192.168.0.17
|
||||
#server_3_alias=Another PC on my network
|
||||
#server_3_port=61209
|
||||
#server_4_name=pasbon
|
||||
#server_4_port=61237
|
||||
|
||||
[passwords]
|
||||
# Define the passwords list
|
||||
# Syntax: host=password
|
||||
# Where: host is the hostname
|
||||
# password is the clear password
|
||||
# Additionally (and optionally) a default password could be defined
|
||||
#localhost=abc
|
||||
#default=defaultpassword
|
||||
@@ -707,7 +707,7 @@ cards:
|
||||
class: "light-unavailable"
|
||||
|
||||
- entities:
|
||||
- switch.shelly_projector
|
||||
# - switch.shelly_projector
|
||||
- binary_sensor.computer_chair_contact_occupied
|
||||
# - switch.computer_area_pi_plug
|
||||
# - switch.computer_area_lighouse
|
||||
|
||||
+16
-11
@@ -1315,22 +1315,27 @@ cards:
|
||||
icon: mdi:cctv
|
||||
state_filter:
|
||||
- "not_home"
|
||||
- entity: device_tracker.amcrest_technologies_32_ae_4e
|
||||
name: Front Room
|
||||
icon: mdi:cctv
|
||||
state_filter:
|
||||
- "not_home"
|
||||
- entity: device_tracker.amcrest_technologies_36_1d_8a
|
||||
name: Back Yard
|
||||
icon: mdi:cctv
|
||||
state_filter:
|
||||
- "not_home"
|
||||
# - entity: device_tracker.amcrest_technologies_32_ae_4e
|
||||
# name: Front Room
|
||||
# icon: mdi:cctv
|
||||
# state_filter:
|
||||
# - "not_home"
|
||||
# - entity: device_tracker.amcrest_technologies_36_1d_8a
|
||||
# name: Back Yard
|
||||
# icon: mdi:cctv
|
||||
# state_filter:
|
||||
# - "not_home"
|
||||
# - entity: device_tracker.amcrest_technologies_36_22_3a
|
||||
# name: Back Yard
|
||||
# icon: mdi:cctv
|
||||
# state_filter:
|
||||
# - "not_home"
|
||||
- entity: device_tracker.amcrest_technologies_35_5d_c3
|
||||
# - entity: device_tracker.amcrest_technologies_35_5d_c3
|
||||
# name: Front Yard
|
||||
# icon: mdi:cctv
|
||||
# state_filter:
|
||||
# - "not_home"
|
||||
- entity: device_tracker.nmap_tracker_f0_00_05_10_b2_ca
|
||||
name: Front Yard
|
||||
icon: mdi:cctv
|
||||
state_filter:
|
||||
|
||||
Reference in New Issue
Block a user