diff --git a/automations/people/Ebin/ebin_home.yaml b/automations/people/Ebin/ebin_home.yaml index 70cbc90..8602584 100644 --- a/automations/people/Ebin/ebin_home.yaml +++ b/automations/people/Ebin/ebin_home.yaml @@ -14,7 +14,7 @@ condition: conditions: - condition: state entity_id: binary_sensor.have_custody - state: "off" + state: "on" - condition: state entity_id: person.kristy state: "home" diff --git a/automations/people/Ebin/ebin_location_update.yaml b/automations/people/Ebin/ebin_location_update.yaml index 151c510..31ad74b 100644 --- a/automations/people/Ebin/ebin_location_update.yaml +++ b/automations/people/Ebin/ebin_location_update.yaml @@ -6,6 +6,15 @@ trigger: # I've moved - platform: state entity_id: + - input_select.podein_kids + # Kristy moved + - input_select.kristy_status_dropdown + - input_boolean.kristy_home + # Custody changed + - binary_sensor.have_custody + # Sleeping status changed + - input_boolean.ebin_is_awake + - input_boolean.ebin_in_bed - input_select.ebin_status_dropdown - input_boolean.ebin_home condition: diff --git a/automations/people/continue_nursery_noise.yaml b/automations/people/continue_nursery_noise.yaml index 41fe6fb..9f05690 100644 --- a/automations/people/continue_nursery_noise.yaml +++ b/automations/people/continue_nursery_noise.yaml @@ -6,7 +6,7 @@ trigger: from: "playing" condition: - condition: state - entity_id: input_boolean.nursery_asleep + entity_id: input_boolean.girls_room_asleep state: "on" - condition: or conditions: diff --git a/automations/people/goodnight_kids.yaml b/automations/people/goodnight_kids.yaml index 2f36bd0..12ef1a5 100644 --- a/automations/people/goodnight_kids.yaml +++ b/automations/people/goodnight_kids.yaml @@ -164,29 +164,6 @@ action: target: entity_id: input_select.nursery_wled - # - action: automation.trigger - # target: - # entity_id: automation.nursery_wled_changed - - # - choose: - # - conditions: "{{is_state('input_boolean.bridget_home','on')}}" - # sequence: - # - action: input_boolean.turn_on - # data: {} - # target: - # entity_id: input_boolean.nursery_asleep - - # - delay: "00:00:05" - - # - choose: - # - conditions: "{{is_state('media_player.ytube_music_player','on')}}" - # sequence: - # - action: media_player.turn_off - # target: - # entity_id: media_player.ytube_music_player - - - delay: "00:25:00" - - choose: - conditions: "{{is_state('input_boolean.emmett_home','on')}}" sequence: @@ -195,6 +172,8 @@ action: target: entity_id: input_boolean.boys_room_asleep + - delay: "00:25:00" + - action: input_select.select_option target: entity_id: input_select.boys_room_mode diff --git a/automations/people/kids_awake.yaml b/automations/people/kids_awake.yaml index cb1a0fc..42fd5b6 100644 --- a/automations/people/kids_awake.yaml +++ b/automations/people/kids_awake.yaml @@ -125,7 +125,9 @@ action: state: "unavailable" sequence: - action: input_boolean.turn_off - entity_id: input_boolean.emmett_in_bed + entity_id: + - input_boolean.emmett_in_bed + - input_boolean.boys_room_asleep - action: input_boolean.turn_on entity_id: input_boolean.emmett_is_awake @@ -147,7 +149,9 @@ action: state: "unavailable" sequence: - action: input_boolean.turn_off - entity_id: input_boolean.bridget_in_bed + entity_id: + - input_boolean.bridget_in_bed + - input_boolean.girls_room_asleep - action: input_boolean.turn_on entity_id: input_boolean.bridget_is_awake diff --git a/automations/rooms/boys_room/boys_room_white_noise_on.yaml b/automations/rooms/boys_room/boys_room_white_noise_on.yaml index 6002880..02a4f7c 100644 --- a/automations/rooms/boys_room/boys_room_white_noise_on.yaml +++ b/automations/rooms/boys_room/boys_room_white_noise_on.yaml @@ -5,13 +5,14 @@ trigger: - platform: state entity_id: input_boolean.boys_room_asleep to: "on" + - platform: state entity_id: media_player.ma_boys_room_clock to: "idle" for: 00:00:05 condition: - - alias: "Do we want to be alerted?" + - alias: "Is the boys' room asleep?" condition: state entity_id: input_boolean.boys_room_asleep state: "on" diff --git a/automations/rooms/furnace_room_lights.yaml b/automations/rooms/furnace_room_lights.yaml index b02f9db..eff01c3 100644 --- a/automations/rooms/furnace_room_lights.yaml +++ b/automations/rooms/furnace_room_lights.yaml @@ -4,9 +4,7 @@ description: "Handles the lights in the furnace room" mode: queued triggers: - id: door_open - entity_id: >- - binary_sensor.hvac_multisensor_door, - binary_sensor.furnace_room_door_contact + entity_id: binary_sensor.water_softener_multisensor_door from: "off" to: "on" trigger: state @@ -14,9 +12,7 @@ triggers: When one of the door sensors detect that the furnace room door has been opened - id: door_closed - entity_id: >- - binary_sensor.hvac_multisensor_door, - binary_sensor.furnace_room_door_contact + entity_id: binary_sensor.water_softener_multisensor_door to: "off" for: "00:10:00" trigger: state diff --git a/automations/rooms/girls_room/girls_room_awake_button.yaml b/automations/rooms/girls_room/girls_room_awake_button.yaml index d905541..c541bf3 100644 --- a/automations/rooms/girls_room/girls_room_awake_button.yaml +++ b/automations/rooms/girls_room/girls_room_awake_button.yaml @@ -28,4 +28,4 @@ action: - action: input_boolean.turn_off data: {} target: - entity_id: input_boolean.nursery_asleep + entity_id: input_boolean.girls_room_asleep diff --git a/automations/rooms/girls_room/girls_room_continue_white_noise.yaml b/automations/rooms/girls_room/girls_room_continue_white_noise.yaml deleted file mode 100644 index f697ce3..0000000 --- a/automations/rooms/girls_room/girls_room_continue_white_noise.yaml +++ /dev/null @@ -1,35 +0,0 @@ -alias: Continue Nursery White Noise -id: automation_continue_nursery_white_noise - -trigger: - - platform: state - entity_id: media_player.girls_room_hub - to: "off" - for: "00:00:02" - - platform: state - entity_id: media_player.girls_room_hub - to: "idle" - for: "00:00:02" -condition: - - condition: state - entity_id: input_boolean.nursery_asleep - state: "on" - -action: - #- action: input_select.select_option - # data: - # entity_id: input_select.master_bedroom_mode - # option: 'Off' - - action: input_select.select_option - data: - entity_id: input_select.google_home - option: "Nursery" - - action: input_select.select_option - data: - entity_id: input_select.ambient_sound - option: "Thunderstorm" - - action: input_number.set_value - data: - entity_id: input_number.volume_ambientsounds - value: "0.6" - - action: script.ambientsounds diff --git a/automations/rooms/girls_room/girls_room_white_noise_off.yaml b/automations/rooms/girls_room/girls_room_white_noise_off.yaml index c97136a..ab8eb24 100644 --- a/automations/rooms/girls_room/girls_room_white_noise_off.yaml +++ b/automations/rooms/girls_room/girls_room_white_noise_off.yaml @@ -3,7 +3,7 @@ id: automation_nursery_white_noise_off trigger: - platform: state - entity_id: input_boolean.nursery_asleep + entity_id: input_boolean.girls_room_asleep to: "off" action: diff --git a/automations/rooms/girls_room/girls_room_white_noise_on.yaml b/automations/rooms/girls_room/girls_room_white_noise_on.yaml index b4adc78..d60752d 100644 --- a/automations/rooms/girls_room/girls_room_white_noise_on.yaml +++ b/automations/rooms/girls_room/girls_room_white_noise_on.yaml @@ -3,9 +3,21 @@ id: automation_nursery_white_noise_on trigger: - platform: state - entity_id: input_boolean.nursery_asleep + entity_id: input_boolean.girls_room_asleep to: "on" + - platform: state + entity_id: media_player.ma_girls_room_hub + to: "idle" + for: 00:00:05 + +condition: + - alias: "Is the girls' room asleep?" + condition: state + entity_id: input_boolean.girls_room_asleep + state: "on" + + action: - choose: - conditions: diff --git a/automations/things/automatic_fan_speeds.yaml b/automations/things/automatic_fan_speeds.yaml index 66416f4..799c755 100644 --- a/automations/things/automatic_fan_speeds.yaml +++ b/automations/things/automatic_fan_speeds.yaml @@ -59,7 +59,7 @@ triggers: entity_id: input_boolean.master_bedroom_occupied - trigger: state - entity_id: input_boolean.nursery_asleep + entity_id: input_boolean.girls_room_asleep - trigger: state entity_id: input_boolean.master_bedroom_asleep @@ -115,7 +115,7 @@ action: state: "off" - alias: "Nusery not asleep" condition: state - entity_id: input_boolean.nursery_asleep + entity_id: input_boolean.girls_room_asleep state: "off" - alias: "Nursery fan on" condition: state diff --git a/automations/time_of_day/early_afternoon_on.yaml b/automations/time_of_day/early_afternoon_on.yaml index e19d74d..73c324c 100644 --- a/automations/time_of_day/early_afternoon_on.yaml +++ b/automations/time_of_day/early_afternoon_on.yaml @@ -1,7 +1,11 @@ id: set_house_to_early_afternoon alias: Set House to Early Afternoon mode: single -# Testing if this will update, save, and push just fine + +# platform: tod +# name: Early Afternoon +# after: '12:00' +# before: '15:00' trigger: - platform: state @@ -19,10 +23,6 @@ condition: state: Early Afternoon action: - # - action: homeassistant.turn_on - # entity_id: - # - input_boolean.clint_needs_pm_meds - - action: input_select.select_option data: entity_id: input_select.time_of_day diff --git a/automations/time_of_day/early_evening_on.yaml b/automations/time_of_day/early_evening_on.yaml index cc8689b..728e4c6 100644 --- a/automations/time_of_day/early_evening_on.yaml +++ b/automations/time_of_day/early_evening_on.yaml @@ -2,6 +2,11 @@ id: set_house_to_early_evening alias: Set House to Early Evening mode: single +# platform: tod +# name: Early Evening +# after: '17:00' +# before: '19:00' + trigger: - platform: state entity_id: binary_sensor.early_evening diff --git a/automations/time_of_day/early_morning_on.yaml b/automations/time_of_day/early_morning_on.yaml index 4635d8f..97ccee4 100644 --- a/automations/time_of_day/early_morning_on.yaml +++ b/automations/time_of_day/early_morning_on.yaml @@ -2,6 +2,11 @@ id: set_house_to_early_morning alias: Set House to Early Morning mode: single +# platform: tod +# name: Early Morning +# after: '04:00' +# before: '06:00' + trigger: - platform: state entity_id: binary_sensor.early_morning diff --git a/automations/time_of_day/evening_on.yaml b/automations/time_of_day/evening_on.yaml index a69d2f0..8e42cfb 100644 --- a/automations/time_of_day/evening_on.yaml +++ b/automations/time_of_day/evening_on.yaml @@ -2,6 +2,11 @@ id: set_house_to_evening alias: Set House to Evening mode: single +# platform: tod +# name: Evening +# after: '19:00' +# before: '22:00' + trigger: - platform: state entity_id: binary_sensor.evening diff --git a/automations/time_of_day/late_afternoon_on.yaml b/automations/time_of_day/late_afternoon_on.yaml index 747e164..8d91c42 100644 --- a/automations/time_of_day/late_afternoon_on.yaml +++ b/automations/time_of_day/late_afternoon_on.yaml @@ -2,6 +2,11 @@ id: set_house_to_late_afternoon alias: Set House to Late Afternoon mode: single +# platform: tod +# name: Late Afternoon +# after: '15:00' +# before: '17:00' + trigger: - platform: state entity_id: binary_sensor.late_afternoon diff --git a/automations/time_of_day/late_evening_on.yaml b/automations/time_of_day/late_evening_on.yaml index da25106..fdc1a35 100644 --- a/automations/time_of_day/late_evening_on.yaml +++ b/automations/time_of_day/late_evening_on.yaml @@ -2,6 +2,11 @@ id: set_house_to_late_evening alias: Set House to Late Evening mode: single +# platform: tod +# name: Late Evening +# after: '22:00' +# before: '00:00' + trigger: - platform: state entity_id: binary_sensor.late_evening @@ -53,7 +58,7 @@ action: - choose: - conditions: - condition: state - entity_id: input_boolean.ebin_in_bed + entity_id: input_boolean.ebin_home state: "on" - condition: state entity_id: input_boolean.ebin_in_bed @@ -64,13 +69,4 @@ action: - action: homeassistant.turn_off entity_id: input_boolean.ebin_is_awake - - choose: - - conditions: - - condition: state - entity_id: media_player.girls_room_hub - state: "playing" - sequence: - - action: media_player.turn_off - entity_id: media_player.girls_room_hub - - delay: "00:00:30" diff --git a/automations/time_of_day/late_morning_on.yaml b/automations/time_of_day/late_morning_on.yaml index 7418019..a47e032 100644 --- a/automations/time_of_day/late_morning_on.yaml +++ b/automations/time_of_day/late_morning_on.yaml @@ -2,6 +2,11 @@ id: set_house_to_late_morning alias: Set House to Late Morning mode: single +# platform: tod +# name: Late Morning +# after: '09:00' +# before: '12:00' + trigger: - platform: state entity_id: binary_sensor.late_morning @@ -66,7 +71,7 @@ action: - choose: - conditions: - condition: state - entity_id: input_boolean.kristy_in_bed + entity_id: input_boolean.kristy_home state: "on" - condition: state entity_id: input_boolean.kristy_in_bed @@ -79,7 +84,7 @@ action: - choose: - conditions: - condition: state - entity_id: input_boolean.marshall_in_bed + entity_id: input_boolean.marshall_home state: "on" - condition: state entity_id: input_boolean.marshall_in_bed @@ -92,7 +97,7 @@ action: - choose: - conditions: - condition: state - entity_id: input_boolean.tess_in_bed + entity_id: input_boolean.tess_home state: "on" - condition: state entity_id: input_boolean.tess_in_bed @@ -105,7 +110,7 @@ action: - choose: - conditions: - condition: state - entity_id: input_boolean.ebin_in_bed + entity_id: input_boolean.ebin_home state: "on" - condition: state entity_id: input_boolean.ebin_in_bed diff --git a/automations/time_of_day/morning_on.yaml b/automations/time_of_day/morning_on.yaml index c81a9b1..da38f43 100644 --- a/automations/time_of_day/morning_on.yaml +++ b/automations/time_of_day/morning_on.yaml @@ -2,6 +2,11 @@ id: set_house_to_morning alias: Set House to Morning mode: single +# platform: tod +# name: Morning +# after: '06:00' +# before: '09:00' + trigger: - platform: state entity_id: binary_sensor.morning @@ -24,6 +29,9 @@ action: option: Morning - action: homeassistant.turn_off - entity_id: input_boolean.nursery_asleep + entity_id: input_boolean.boys_room_asleep + + - action: homeassistant.turn_off + entity_id: input_boolean.girls_room_asleep - delay: "00:00:30" diff --git a/automations/time_of_day/night_on.yaml b/automations/time_of_day/night_on.yaml index 3435024..306b396 100644 --- a/automations/time_of_day/night_on.yaml +++ b/automations/time_of_day/night_on.yaml @@ -2,6 +2,11 @@ id: set_house_to_night alias: Set House to Night mode: single +# platform: tod +# name: Night +# after: '00:00' +# before: '04:00' + trigger: - platform: state entity_id: binary_sensor.night @@ -41,7 +46,7 @@ action: - choose: - conditions: - condition: state - entity_id: input_boolean.tess_in_bed + entity_id: input_boolean.tess_home state: "on" - condition: state entity_id: input_boolean.tess_in_bed diff --git a/components/binary_sensors/template.yaml b/components/binary_sensors/template.yaml index 35c17a4..e7d01a5 100644 --- a/components/binary_sensors/template.yaml +++ b/components/binary_sensors/template.yaml @@ -687,7 +687,7 @@ sensors: need_salt: unique_id: templatebinarysensor.need_salt friendly_name: Need Salt - value_template: "{{ is_state('binary_sensor.hvac_multisensor_status', 'on') and is_state('sensor.hvac_multisensor_salt_level_in_bags','0') }}" + value_template: "{{ is_state('binary_sensor.water_softener_multisensor_status', 'on') and is_state('sensor.water_softener_multisensor_salt_level_in_bags','0') }}" icon_template: mdi:shaker-outline delay_on: seconds: 900 diff --git a/components/input_booleans/rooms/master_bedroom_asleep.yaml b/components/input_booleans/rooms/master_bedroom_asleep.yaml deleted file mode 100644 index 9893698..0000000 --- a/components/input_booleans/rooms/master_bedroom_asleep.yaml +++ /dev/null @@ -1,2 +0,0 @@ -name: Master Bedroom Asleep -icon: mdi:sleep diff --git a/components/input_booleans/rooms/nursery_asleep.yaml b/components/input_booleans/rooms/nursery_asleep.yaml deleted file mode 100644 index fb36c92..0000000 --- a/components/input_booleans/rooms/nursery_asleep.yaml +++ /dev/null @@ -1,2 +0,0 @@ -name: Nursery Asleep -icon: mdi:sleep diff --git a/components/input_booleans/rooms/nursery_white_noise.yaml b/components/input_booleans/rooms/nursery_white_noise.yaml deleted file mode 100644 index 5fd4fb4..0000000 --- a/components/input_booleans/rooms/nursery_white_noise.yaml +++ /dev/null @@ -1 +0,0 @@ -name: Nursery White Noise diff --git a/components/packages/patio_door_lock.yaml b/components/packages/patio_door_lock.yaml index 0ab6a37..a7a791f 100644 --- a/components/packages/patio_door_lock.yaml +++ b/components/packages/patio_door_lock.yaml @@ -2,12 +2,19 @@ lock: - platform: template unique_id: templatelock.patio_door name: Patio Door - value_template: "{{ is_state('switch.shelly_sliding_glass_door', 'on') }}" + #value_template: "{{ is_state('switch.shelly_sliding_glass_door', 'on') }}" + value_template: "{{ is_state('light.deck', 'on') }}" lock: - action: switch.turn_on + # action: switch.turn_on + # target: + # entity_id: switch.shelly_sliding_glass_door + action: light.turn_on target: - entity_id: switch.shelly_sliding_glass_door + entity_id: light.deck unlock: - action: switch.turn_off + # action: switch.turn_off + # target: + # entity_id: switch.shelly_sliding_glass_door + action: light.turn_off target: - entity_id: switch.shelly_sliding_glass_door + entity_id: light.deck diff --git a/esphome/archive/hvac-multisensor.yaml b/esphome/archive/hvac-multisensor.yaml index 9bda855..29083d1 100644 --- a/esphome/archive/hvac-multisensor.yaml +++ b/esphome/archive/hvac-multisensor.yaml @@ -8,11 +8,17 @@ substitutions: board: wemos_d1_mini32 static_ip: !secret hvac-multisensor-ip +# For i2c devices +# In this case it's just the display sda_pin: GPIO21 scl_pin: GPIO22 + door_pin: GPIO19 - one_wire_pin: GPIO14 - trigger_pin: GPIO04 + + one_wire_pin: GPIO26 + +# For the ultrasonic sensor + trigger_pin: GPIO16 echo_pin: GPIO13 #mdc_pin: GPIO23 @@ -21,8 +27,8 @@ substitutions: #power_pin: GPIO5 packages: - #wifi: !include common/wifi_no_power_save.yaml - ethernet: !include common/ethernet.yaml + # network: !include common/ethernet.yaml + network: !include common/wifi.yaml device_base: !include common/device_base.yaml ble_proxy: !include common/ble_proxy.yaml @@ -30,34 +36,14 @@ esphome: name: ${devicename} friendly_name: ${friendly_name} name_add_mac_suffix: false - on_boot: - - priority: -100 - then: - - lambda: |- - if (id(oled)) { - id(oled_enabled) = true; - } else { - id(oled_enabled) = false; - } esp32: board: ${board} framework: type: esp-idf -# web_server: -# port: 80 -# version: 3 -# include_internal: true - # Enable logging logger: - level: DEBUG - logs: - sensor: INFO - component: INFO - ultrasonic: INFO - ethernet: DEBUG api: # Using settings from common/device_base.yaml @@ -74,13 +60,22 @@ globals: - id: screen_power type: bool restore_value: yes - initial_value: 'true' + initial_value: 'false' font: - - file: 'CascadiaMonoPL.ttf' + - file: 'fonts/CascadiaMonoPL.ttf' id: font1 size: 17 + # - file: "gfonts://Roboto" + # id: roboto_20 + # size: 20 + + # - file: "gfonts://Material+Symbols+Outlined" + # id: icons_50 + # size: 50 + # glyphs: ["\U0000e425"] # mdi-timer + one_wire: - platform: gpio pin: ${one_wire_pin} @@ -142,7 +137,7 @@ sensor: trigger_pin: ${trigger_pin} echo_pin: ${echo_pin} id: ultrasonic_source - #update_interval: 5s + update_interval: 1s internal: True filters: - sliding_window_moving_average: @@ -221,24 +216,21 @@ binary_sensor: filters: - invert: -# switch: -# - platform: template -# id: display_switch -# name: "Display" -# lambda: |- -# if (id(oled_enabled)) { -# if (id(screen_power)) { -# id(oled).turn_on(); -# } else { -# id(oled).turn_off(); -# } -# } -# return id(screen_power); -# turn_on_action: -# - lambda: |- -# id(screen_power) = true; -# // id(oled).turn_on(); -# turn_off_action: -# - lambda: |- -# id(screen_power) = false; -# // id(oled).turn_off(); +switch: + - platform: template + id: display_switch + icon: mdi:console + name: "Display" + lambda: |- + // if (id(screen_power)) { + // id(oled).turn_on(); + // } else { + // id(oled).turn_off(); + // } + return id(screen_power); + turn_on_action: + - lambda: |- + id(screen_power) = true; + turn_off_action: + - lambda: |- + id(screen_power) = false; diff --git a/esphome/archive/water-softener-multisensor.yaml b/esphome/archive/water-softener-multisensor.yaml new file mode 100644 index 0000000..2b90b0f --- /dev/null +++ b/esphome/archive/water-softener-multisensor.yaml @@ -0,0 +1,111 @@ +# 3v3 en svp sun 34 35 32 33 25 26 27 14 12 gnd 13 sd2 sd3 gnd 5v +substitutions: + devicename: water-softener-multisensor + entity_name: water_softener_multisensor + friendly_name: Water Softener MultiSensor + comment: Clever Water Softener MultiSensor + platform: ESP32 + board: wemos_d1_mini32 + static_ip: !secret water-softener-multisensor-ip + + door_pin: GPIO18 + +# For the ultrasonic sensor + trigger_pin: GPIO16 + echo_pin: GPIO17 + +packages: + # network: !include common/ethernet.yaml + network: !include common/wifi.yaml + device_base: !include common/device_base.yaml + ble_proxy: !include common/ble_proxy.yaml + +esphome: + name: ${devicename} + friendly_name: ${friendly_name} + name_add_mac_suffix: false + +esp32: + board: ${board} + framework: + type: esp-idf + +# Enable logging +logger: + +api: # Using settings from common/device_base.yaml + +ota: # Using settings from common/device_base.yaml + +esp32_ble_tracker: + +sensor: + - platform: ultrasonic + trigger_pin: ${trigger_pin} + echo_pin: ${echo_pin} + id: ultrasonic_source + update_interval: 1s + internal: True + filters: + - sliding_window_moving_average: + window_size: 5 + send_every: 5 + send_first_at: 1 + on_value: + then: + - sensor.template.publish: + id: distance_from_bottom + state: !lambda 'return id(ultrasonic_source).state;' + + - sensor.template.publish: + id: distance_from_top + state: !lambda 'return id(ultrasonic_source).state;' + + - platform: template + unit_of_measurement: "cm" + state_class: measurement + id: distance_from_bottom + name: "Salt Level in CM" + icon: mdi:arrow-collapse-up + disabled_by_default: true + #update_interval: 5s + filters: + - lambda: 'return (0.94 - (id(ultrasonic_source).state)) * 100;' + on_value: + then: + - sensor.template.publish: + id: level_in_bags + state: !lambda 'return id(distance_from_bottom).state;' + + - platform: template + unit_of_measurement: "cm" + state_class: measurement + id: distance_from_top + name: "Salt Level From Top in CM" + icon: mdi:arrow-collapse-down + disabled_by_default: true + #update_interval: 5s + filters: + - lambda: 'return (id(ultrasonic_source).state) * 100;' + + - platform: template + unit_of_measurement: "bags" + state_class: measurement + id: level_in_bags + name: "Salt Level in Bags" + icon: mdi:counter + disabled_by_default: true + #update_interval: 5s + filters: + - lambda: 'return (id(distance_from_bottom).state) / 17.5;' + +binary_sensor: + - platform: gpio + name: "Door" + device_class: door + pin: + number: ${door_pin} + mode: INPUT_PULLUP + # filters: + # - invert: + diff --git a/esphome/common/text_sensor/wifi_sensor.config.yaml b/esphome/common/text_sensor/wifi_sensor.config.yaml index e6cbb96..f41c01f 100644 --- a/esphome/common/text_sensor/wifi_sensor.config.yaml +++ b/esphome/common/text_sensor/wifi_sensor.config.yaml @@ -3,14 +3,17 @@ platform: wifi_info ip_address: name: IP icon: mdi:ip + update_interval: 60s disabled_by_default: true ssid: name: SSID icon: mdi:lan + update_interval: 60s disabled_by_default: true bssid: name: BSSID disabled_by_default: true + update_interval: 60s icon: mdi:router-network mac_address: name: Wifi MAC Address diff --git a/esphome/fonts/CascadiaMono.ttf b/esphome/fonts/CascadiaMono.ttf new file mode 100644 index 0000000..f6f62d4 Binary files /dev/null and b/esphome/fonts/CascadiaMono.ttf differ diff --git a/esphome/fonts/CascadiaMonoPL.ttf b/esphome/fonts/CascadiaMonoPL.ttf deleted file mode 100644 index acab3f3..0000000 Binary files a/esphome/fonts/CascadiaMonoPL.ttf and /dev/null differ diff --git a/esphome/fonts/RobotoCondensed-Regular.ttf b/esphome/fonts/RobotoCondensed-Regular.ttf new file mode 100644 index 0000000..9abc0e9 Binary files /dev/null and b/esphome/fonts/RobotoCondensed-Regular.ttf differ diff --git a/esphome/fonts/materialdesignicons-webfont.ttf b/esphome/fonts/materialdesignicons-webfont.ttf new file mode 100644 index 0000000..bba7dcf Binary files /dev/null and b/esphome/fonts/materialdesignicons-webfont.ttf differ diff --git a/esphome/hvac-multisensor.yaml b/esphome/hvac-multisensor.yaml index 29083d1..a21bced 100644 --- a/esphome/hvac-multisensor.yaml +++ b/esphome/hvac-multisensor.yaml @@ -5,32 +5,41 @@ substitutions: friendly_name: HVAC MultiSensor comment: Clever MultiSensor platform: ESP32 - board: wemos_d1_mini32 + board: esp32-wroom-32d + variant: esp32 + # framework: esp-idf + framework: arduino static_ip: !secret hvac-multisensor-ip +# Backlight Button + backlight_button: GPIO34 + +# For TFT Display + tft_dc_pin: GPIO02 + tft_reset_pin: GPIO04 + tft_cs_pin: GPIO15 + tft_backlight_pin: GPIO32 + +# For SPI and TFT + spi_miso_pin: GPIO19 + spi_mosi_pin: GPIO23 + spi_clock_pin: GPIO18 + +# For Touchscreen + touchscreen_irq_pin: GPIO27 + # For i2c devices -# In this case it's just the display sda_pin: GPIO21 scl_pin: GPIO22 - door_pin: GPIO19 - - one_wire_pin: GPIO26 - -# For the ultrasonic sensor - trigger_pin: GPIO16 - echo_pin: GPIO13 - - #mdc_pin: GPIO23 - #mdio_pin: GPIO18 - #clk_mode: GPIO17_OUT - #power_pin: GPIO5 + passive_buzzer_pin: GPIO26 + one_wire_pin: GPIO17 packages: # network: !include common/ethernet.yaml network: !include common/wifi.yaml device_base: !include common/device_base.yaml - ble_proxy: !include common/ble_proxy.yaml + # ble_proxy: !include common/ble_proxy.yaml esphome: name: ${devicename} @@ -38,34 +47,103 @@ esphome: name_add_mac_suffix: false esp32: - board: ${board} + # board: ${board} + variant: ${variant} framework: - type: esp-idf + type: ${framework} # Enable logging logger: + level: VERBOSE + +time: + - id: !remove homeassistant_time + - platform: sntp + id: sntp_time + timezone: America/Detroit + on_time: + - hours: 2,3,4,5 + minutes: 5 + seconds: 0 + then: + - switch.turn_on: switch_antiburn + - hours: 2,3,4,5 + minutes: 35 + seconds: 0 + then: + - switch.turn_off: switch_antiburn api: # Using settings from common/device_base.yaml + actions: + - action: play_rtttl + variables: + song_str: string + then: + - rtttl.play: !lambda 'return song_str;' + on_client_connected: + - logger.log: + format: "Client %s connected to API with IP %s" + args: ["client_info.c_str()", "client_address.c_str()"] + - if: + condition: + lambda: 'return (0 == client_info.find("Home Assistant "));' + then: + - lvgl.widget.show: lbl_hastatus + on_client_disconnected: + - logger.log: + format: "Client %s disconnected to API with IP %s" + args: ["client_info.c_str()", "client_address.c_str()"] + - if: + condition: + lambda: 'return (0 == client_info.find("Home Assistant "));' + then: + - lvgl.widget.hide: lbl_hastatus ota: # Using settings from common/device_base.yaml -esp32_ble_tracker: +# esp32_ble_tracker: -globals: - - id: oled_enabled - type: bool - restore_value: yes - initial_value: 'false' +# globals: + # - id: oled_enabled + # type: bool + # restore_value: yes + # initial_value: 'false' - - id: screen_power - type: bool - restore_value: yes - initial_value: 'false' + # - id: screen_power + # type: bool + # restore_value: yes + # initial_value: 'false' font: - - file: 'fonts/CascadiaMonoPL.ttf' - id: font1 - size: 17 + # - file: 'fonts/CascadiaMonoPL.ttf' + # id: regular_20 + # size: 20 + # bpp: 4 + # extras: + # - file: "fonts/materialdesignicons-webfont.ttf" + # glyphs: [ + # "\U000F02D1", # mdi-heart + # "\U000F05D4", # mdi-airplane-landing + # "\U000F02DC", # mdi-home + # "\U000F035E", # mdi-menu-left + # "\U000F035F", # mdi-menu-right + # ] + + - file: 'fonts/RobotoCondensed-Regular.ttf' + id: regular_20 + size: 20 + bpp: 4 + extras: + - file: "fonts/materialdesignicons-webfont.ttf" + glyphs: [ + "\U000F02DC", # mdi-home + "\U000F035E", # mdi-menu-left + "\U000F035F", # mdi-menu-right + "\U000F05A9", # mdi-wifi + "\U000F19B2", # mdi-arrow-up-thin + "\U000F19B3", # mdi-arrow-down-thin + "\U000F04DB", # mdi-stop + ] # - file: "gfonts://Roboto" # id: roboto_20 @@ -78,13 +156,92 @@ font: one_wire: - platform: gpio - pin: ${one_wire_pin} + pin: + number: ${one_wire_pin} + mode: + input: true + pullup: true i2c: sda: ${sda_pin} scl: ${scl_pin} frequency: 800kHz +spi: + clk_pin: ${spi_clock_pin} + mosi_pin: ${spi_mosi_pin} + miso_pin: ${spi_miso_pin} + +output: + - platform: ledc + pin: ${tft_backlight_pin} + id: backlight_pwm + + - platform: ledc + pin: ${passive_buzzer_pin} + id: rtttl_out + +rtttl: + output: rtttl_out + id: buzzer + gain: 60% + +switch: + - platform: template + name: Antiburn + id: switch_antiburn + icon: mdi:television-shimmer + optimistic: true + entity_category: "config" + turn_on_action: + - logger.log: "Starting Antiburn" + - if: + condition: lvgl.is_paused + then: + - lvgl.resume: + - lvgl.widget.redraw: + - lvgl.pause: + show_snow: true + turn_off_action: + - logger.log: "Stopping Antiburn" + - if: + condition: lvgl.is_paused + then: + - lvgl.resume: + - lvgl.widget.redraw: + +light: + - platform: monochromatic + output: backlight_pwm + name: "Display Backlight" + id: display_backlight + restore_mode: RESTORE_DEFAULT_OFF + +number: + - platform: template + name: LVGL Screen timeout + optimistic: true + id: display_timeout + unit_of_measurement: "s" + initial_value: 30 + restore_value: true + min_value: 10 + max_value: 180 + step: 5 + mode: box + +# binary_sensor: +# - platform: gpio +# pin: +# number: ${backlight_button} +# id: backlight_switch +# filters: +# - delayed_on: 10ms +# - delayed_off: 10ms +# on_press: +# - light.toggle: +# id: display_backlight + sensor: - platform: dallas_temp address: 0xB33C01B607798528 @@ -93,7 +250,16 @@ sensor: icon: mdi:home-thermometer-outline update_interval: 10s filters: - - lambda: return x * (9.0/5.0) + 32.0; + - lambda: |- + float val = x; + if (isnan(val)) { + val = 0.0; + } + return val * (9.0/5.0) + 32.0; + #- lambda: return x * (9.0/5.0) + 32.0; + - clamp: + min_value: 0.0 + max_value: 100.0 unit_of_measurement: "°F" state_class: measurement @@ -105,6 +271,9 @@ sensor: update_interval: 10s filters: - lambda: return x * (9.0/5.0) + 32.0; + - clamp: + min_value: 0.0 + max_value: 100.0 unit_of_measurement: "°F" state_class: measurement @@ -116,6 +285,9 @@ sensor: update_interval: 10s filters: - lambda: return x * (9.0/5.0) + 32.0; + - clamp: + min_value: 0.0 + max_value: 100.0 unit_of_measurement: "°F" state_class: measurement @@ -129,108 +301,401 @@ sensor: unit_of_measurement: "°F" state_class: measurement filters: + - clamp: + min_value: 0.0 + max_value: 100.0 - or: - throttle: 60s - delta: 1.0 - - platform: ultrasonic - trigger_pin: ${trigger_pin} - echo_pin: ${echo_pin} - id: ultrasonic_source - update_interval: 1s - internal: True - filters: - - sliding_window_moving_average: - window_size: 5 - send_every: 5 - send_first_at: 1 - on_value: - then: - - sensor.template.publish: - id: distance_from_bottom - state: !lambda 'return id(ultrasonic_source).state;' - - - sensor.template.publish: - id: distance_from_top - state: !lambda 'return id(ultrasonic_source).state;' - - - platform: template - unit_of_measurement: "cm" - state_class: measurement - id: distance_from_bottom - name: "Salt Level in CM" - icon: mdi:arrow-collapse-up - disabled_by_default: true - #update_interval: 5s - filters: - - lambda: 'return (0.94 - (id(ultrasonic_source).state)) * 100;' - on_value: - then: - - sensor.template.publish: - id: level_in_bags - state: !lambda 'return id(distance_from_bottom).state;' - - - platform: template - unit_of_measurement: "cm" - state_class: measurement - id: distance_from_top - name: "Salt Level From Top in CM" - icon: mdi:arrow-collapse-down - disabled_by_default: true - #update_interval: 5s - filters: - - lambda: 'return (id(ultrasonic_source).state) * 100;' - - - platform: template - unit_of_measurement: "bags" - state_class: measurement - id: level_in_bags - name: "Salt Level in Bags" - icon: mdi:counter - disabled_by_default: true - #update_interval: 5s - filters: - - lambda: 'return (id(distance_from_bottom).state) / 17.5;' - display: - - platform: ssd1306_i2c - id: oled - model: "SSD1306 128x64" - #reset_pin: GPIO14 #D0 - address: 0x3C - lambda: |- - it.print(0, 0, id(font1), "Delta:"); - it.printf(128, 0, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(hvac_delta).state); - it.print(0, 16, id(font1), "Supply:"); - it.printf(128, 16, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(hvac_supply).state); - it.print(0, 32, id(font1), "Return:"); - it.printf(128, 32, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(hvac_return).state); - it.print(0, 48, id(font1), "Ambient:"); - it.printf(128, 48, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(ambient).state); + - platform: ili9xxx + id: main_display + # data_rate: 20MHz + # spi_mode: MODE3 + # color_palette: 8BIT + invert_colors: false + auto_clear_enabled: false + update_interval: never + model: ili9488 + dc_pin: ${tft_dc_pin} + reset_pin: ${tft_reset_pin} + cs_pin: ${tft_cs_pin} + transform: + swap_xy: true + mirror_x: true + dimensions: + height: 480 + width: 320 -binary_sensor: - - platform: gpio - name: "Door" - device_class: door - pin: ${door_pin} - filters: - - invert: +touchscreen: + # - platform: ft5x06 + - platform: ft63x6 + id: main_touchscreen + display: main_display + transform: + swap_xy: true + mirror_y: true + interrupt_pin: ${touchscreen_irq_pin} + # on_touch: + # - lambda: |- + # ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d", + # touch.x, + # touch.y, + # touch.x_raw, + # touch.y_raw + # ); + on_release: + - if: + condition: lvgl.is_paused + then: + - logger.log: "LVGL resuming" + - lvgl.resume: + - lvgl.widget.redraw: + - if: + condition: + light.is_off: display_backlight + then: + - light.turn_on: display_backlight -switch: - - platform: template - id: display_switch - icon: mdi:console - name: "Display" - lambda: |- - // if (id(screen_power)) { - // id(oled).turn_on(); - // } else { - // id(oled).turn_off(); - // } - return id(screen_power); - turn_on_action: - - lambda: |- - id(screen_power) = true; - turn_off_action: - - lambda: |- - id(screen_power) = false; +lvgl: + buffer_size: 25% + displays: main_display + top_layer: + widgets: + - label: + text: "\U000F05A9" + id: lbl_hastatus + hidden: true + align: top_right + x: -2 + y: 7 + text_align: right + + - buttonmatrix: + align: bottom_mid + styles: header_footer + pad_all: 0 + outline_width: 0 + id: top_layer + items: + styles: header_footer + rows: + - buttons: + - id: page_prev + text: "\U000F035E" + on_press: + then: + lvgl.page.previous: + - id: page_home + text: "\U000F02DC" + on_press: + then: + lvgl.page.show: main_page + - id: page_next + text: "\U000F035F" + on_press: + then: + lvgl.page.next: + on_idle: + timeout: !lambda "return (id(display_timeout).state * 1000);" + then: + - logger.log: "LVGL is idle" + - light.turn_off: display_backlight + - lvgl.pause: + + pages: + - id: room_page + widgets: + - obj: # a properly placed coontainer object for all these controls + align: CENTER + width: 400 + height: 256 + pad_all: 2 + bg_color: 0x414559 + bg_opa: TRANSP + border_opa: TRANSP + layout: # enable the GRID layout for the children widgets + pad_row: 6 + pad_column: 8 + type: GRID # split the rows and the columns proportionally + grid_columns: [FR(1), FR(1), FR(1)] # equal + grid_rows: [FR(10), FR(30), FR(30), FR(30)] # like percents + widgets: + - label: + text: "Red" + grid_cell_column_pos: 0 # place the widget in + grid_cell_row_pos: 0 # the corresponding cell + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + - button: + id: but_cov_up_east + bg_color: 0xFF0000 + grid_cell_column_pos: 0 + grid_cell_row_pos: 1 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + widgets: + - label: + id: cov_up_east + align: CENTER + text: "\U000F19B2" + - button: + id: but_cov_stop_east + bg_color: 0xFF0000 + grid_cell_column_pos: 0 + grid_cell_row_pos: 2 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + widgets: + - label: + id: cov_stop_east + align: CENTER + text: "\U000F04DB" + - button: + id: but_cov_down_east + bg_color: 0xFF0000 + grid_cell_column_pos: 0 + grid_cell_row_pos: 3 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + widgets: + - label: + id: cov_down_east + align: CENTER + text: "\U000F19B3" + + - label: + text: "Green" + grid_cell_column_pos: 1 + grid_cell_row_pos: 0 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + - button: + id: but_cov_up_south + bg_color: 0x00FF00 + grid_cell_column_pos: 1 + grid_cell_row_pos: 1 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + widgets: + - label: + id: cov_up_south + align: CENTER + text: "\U000F19B2" + - button: + id: but_cov_stop_south + bg_color: 0x00FF00 + grid_cell_column_pos: 1 + grid_cell_row_pos: 2 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + widgets: + - label: + id: cov_stop_south + align: CENTER + text: "\U000F04DB" + - button: + id: but_cov_down_south + bg_color: 0x00FF00 + grid_cell_column_pos: 1 + grid_cell_row_pos: 3 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + widgets: + - label: + id: cov_down_south + align: CENTER + text: "\U000F19B3" + + - label: + text: "Blue" + grid_cell_column_pos: 2 + grid_cell_row_pos: 0 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + - button: + id: but_cov_up_west + bg_color: 0x0000FF + grid_cell_column_pos: 2 + grid_cell_row_pos: 1 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + widgets: + - label: + id: cov_up_west + align: CENTER + text: "\U000F19B2" + - button: + id: but_cov_stop_west + bg_color: 0x0000FF + grid_cell_column_pos: 2 + grid_cell_row_pos: 2 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + widgets: + - label: + id: cov_stop_west + align: CENTER + text: "\U000F04DB" + - button: + id: but_cov_down_west + bg_color: 0x0000FF + grid_cell_column_pos: 2 + grid_cell_row_pos: 3 + grid_cell_x_align: STRETCH + grid_cell_y_align: STRETCH + widgets: + - label: + id: cov_down_west + align: CENTER + text: "\U000F19B3" + - id: main_page + widgets: + - obj: + align: TOP_MID + styles: header_footer + widgets: + - label: + text: "ESPHome LVGL Display" + align: CENTER + text_align: CENTER + - label: + align: CENTER + text: 'Hello World!' + - label: + align: LEFT_MID + text: 'Left Mid' + - label: + align: RIGHT_MID + text: 'Right Mid' + - id: second_page + widgets: + - obj: + align: TOP_MID + styles: header_footer + widgets: + - label: + text: "A second page" + align: CENTER + text_align: CENTER + - label: + align: CENTER + text: 'Hello Again!' + - id: third_page + widgets: + - obj: + align: TOP_MID + styles: header_footer + widgets: + - label: + text: "A third page" + align: CENTER + text_align: CENTER + - label: + align: CENTER + text: 'I am the very model of a modern major general' + - id: fourth_page + widgets: + - obj: + align: TOP_MID + styles: header_footer + widgets: + - label: + text: "A fourth page" + align: CENTER + text_align: CENTER + - label: + align: CENTER + text: "I've information vegetable animal and mineral" + + theme: + label: + text_font: regular_20 # set all your labels to use your custom defined font + text_color: 0xcad3f5 + button: + bg_color: 0x24273a + bg_grad_color: 0x005782 + bg_grad_dir: VER + bg_opa: COVER + border_color: 0x0077b3 + border_width: 1 + text_color: 0xcad3f5 + pressed: # set some button colors to be different in pressed state + bg_color: 0x006699 + bg_grad_color: 0x00334d + checked: # set some button colors to be different in checked state + bg_color: 0x1d5f96 + bg_grad_color: 0x03324A + text_color: 0xfff300 + buttonmatrix: + bg_opa: TRANSP + border_color: 0x0077b3 + border_width: 0 + text_color: 0xcad3f5 + pad_all: 0 + items: # set all your buttonmatrix buttons to use your custom defined styles and font + bg_color: 0x24273a + bg_grad_color: 0x005782 + bg_grad_dir: VER + bg_opa: COVER + border_color: 0x0077b3 + border_width: 1 + text_color: 0xcad3f5 + text_font: regular_20 + pressed: + bg_color: 0x006699 + bg_grad_color: 0x00334d + checked: + bg_color: 0x1d5f96 + bg_grad_color: 0x03324A + text_color: 0x005580 + switch: + bg_color: 0xC0C0C0 + bg_grad_color: 0xb0b0b0 + bg_grad_dir: VER + bg_opa: COVER + checked: + bg_color: 0x1d5f96 + bg_grad_color: 0x03324A + bg_grad_dir: VER + bg_opa: COVER + knob: + bg_color: 0xFFFFFF + bg_grad_color: 0xC0C0C0 + bg_grad_dir: VER + bg_opa: COVER + slider: + border_width: 1 + border_opa: 15% + bg_color: 0xcccaca + bg_opa: 15% + indicator: + bg_color: 0x1d5f96 + bg_grad_color: 0x03324A + bg_grad_dir: VER + bg_opa: COVER + knob: + bg_color: 0x24273a + bg_grad_color: 0x005782 + bg_grad_dir: VER + bg_opa: COVER + border_color: 0x0077b3 + border_width: 1 + text_color: 0xcad3f5 + + style_definitions: + - id: header_footer + bg_color: 0x24273a + bg_grad_color: 0x005782 + bg_grad_dir: VER + bg_opa: COVER + border_opa: TRANSP + radius: 0 + pad_all: 0 + pad_row: 0 + pad_column: 0 + border_color: 0x0077b3 + text_color: 0xcad3f5 + width: 100% + height: 30 \ No newline at end of file diff --git a/esphome/power-monitor.yaml b/esphome/power-monitor.yaml index 0e3845c..495c8eb 100644 --- a/esphome/power-monitor.yaml +++ b/esphome/power-monitor.yaml @@ -92,6 +92,7 @@ esp32: time: - platform: sntp id: sntp_time + timezone: America/Detroit logger: level: DEBUG diff --git a/esphome/water-softener-multisensor.yaml b/esphome/water-softener-multisensor.yaml new file mode 100644 index 0000000..3eeee23 --- /dev/null +++ b/esphome/water-softener-multisensor.yaml @@ -0,0 +1,123 @@ +# 3v3 en svp sun 34 35 32 33 25 26 27 14 12 gnd 13 sd2 sd3 gnd 5v +substitutions: + devicename: water-softener-multisensor + entity_name: water_softener_multisensor + friendly_name: Water Softener MultiSensor + comment: Clever Water Softener MultiSensor + board: nodemcuv2 + static_ip: !secret water-softener-multisensor-ip + + door_pin: D5 + +# For the ultrasonic sensor + trigger_pin: D7 + echo_pin: D6 + +packages: + # network: !include common/ethernet.yaml + network: !include common/wifi.yaml + device_base: !include common/device_base.yaml + +esphome: + name: ${devicename} + friendly_name: ${friendly_name} + name_add_mac_suffix: false + +esp8266: + board: ${board} + +# Enable logging +logger: + +api: # Using settings from common/device_base.yaml + +ota: # Using settings from common/device_base.yaml + +sensor: + - platform: ultrasonic + trigger_pin: ${trigger_pin} + echo_pin: ${echo_pin} + id: ultrasonic_source + update_interval: 1s + internal: True + filters: + - sliding_window_moving_average: + window_size: 5 + send_every: 5 + send_first_at: 1 + - lambda: 'return round( x * 10.0) / 10.0;' + - clamp: + min_value: 0.0 + max_value: 150.0 + on_value: + then: + - sensor.template.publish: + id: distance_from_bottom + state: !lambda 'return id(ultrasonic_source).state;' + + - sensor.template.publish: + id: distance_from_top + state: !lambda 'return id(ultrasonic_source).state;' + + - platform: template + unit_of_measurement: "cm" + state_class: measurement + id: distance_from_bottom + name: "Salt Level in CM" + icon: mdi:arrow-collapse-up + disabled_by_default: true + #update_interval: 5s + filters: + - lambda: 'return (0.94 - x) * 100;' + - clamp: + min_value: 0.0 + max_value: 150.0 + + on_value: + then: + - sensor.template.publish: + id: level_in_bags + state: !lambda 'return id(distance_from_bottom).state;' + + - platform: template + unit_of_measurement: "cm" + state_class: measurement + id: distance_from_top + name: "Salt Level From Top in CM" + icon: mdi:arrow-collapse-down + disabled_by_default: true + #update_interval: 5s + filters: + - lambda: 'return x * 100;' + - round: 1 + - clamp: + min_value: 0.0 + max_value: 150.0 + + + - platform: template + unit_of_measurement: "bags" + state_class: measurement + id: level_in_bags + name: "Salt Level in Bags" + icon: mdi:counter + disabled_by_default: true + #update_interval: 5s + filters: + - lambda: 'return x / 17.5;' + - round: 1 + - clamp: + min_value: 0.0 + max_value: 10.0 + + +binary_sensor: + - platform: gpio + name: "Door" + device_class: door + pin: + number: ${door_pin} + mode: INPUT_PULLUP + # filters: + # - invert: + diff --git a/lovelace/cameras/view-camera-01.yaml b/lovelace/cameras/view-camera-01.yaml index 8df6108..241a76d 100644 --- a/lovelace/cameras/view-camera-01.yaml +++ b/lovelace/cameras/view-camera-01.yaml @@ -88,6 +88,7 @@ card: style: left: 50% top: 95% + - type: state-icon entity: input_boolean.boys_room_occupied tap_action: @@ -95,6 +96,7 @@ card: style: left: 70% top: 95% + - type: state-icon entity: binary_sensor.boys_room_occupied style: @@ -169,11 +171,17 @@ card: - type: state-icon entity: binary_sensor.white_bed_occupied style: - top: 45% - left: 40% + top: 55% + left: 25% - type: state-icon entity: media_player.boys_room_clock style: - left: 38% - top: 22% + left: 21% + top: 75% + + - type: state-icon + entity: light.accent + style: + left: 6% + top: 49% \ No newline at end of file diff --git a/lovelace/frigate/view-ai-cam14.yaml b/lovelace/frigate/view-ai-cam14.yaml index f124aea..47bae39 100644 --- a/lovelace/frigate/view-ai-cam14.yaml +++ b/lovelace/frigate/view-ai-cam14.yaml @@ -47,7 +47,8 @@ cards: entity: binary_sensor.frigate_cam14_person_occupancy - type: custom:advanced-camera-card cameras: - - camera_entity: camera.frigate_cam14 + - camera_entity: camera.frigate_cam12 + # - camera_entity: camera.frigate_cam14 title: Person icon: mdi:slide live_provider: ha diff --git a/lovelace/phone/front-room.yaml b/lovelace/phone/front-room.yaml index bbba69d..d64e434 100644 --- a/lovelace/phone/front-room.yaml +++ b/lovelace/phone/front-room.yaml @@ -65,7 +65,7 @@ sections: layout: vertical tap_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: input_boolean.front_room_light_cycle diff --git a/lovelace/phone/furnace-room.yaml b/lovelace/phone/furnace-room.yaml index 75a22a5..1bbb1f9 100644 --- a/lovelace/phone/furnace-room.yaml +++ b/lovelace/phone/furnace-room.yaml @@ -43,7 +43,7 @@ cards: - type: horizontal-stack cards: - type: custom:mushroom-entity-card - entity: switch.hvac_multisensor_display + entity: light.hvac_multisensor_display_backlight name: HVAC Display icon: mdi:monitor layout: vertical diff --git a/lovelace/phone/girls-room.yaml b/lovelace/phone/girls-room.yaml index d411242..1b5c00a 100644 --- a/lovelace/phone/girls-room.yaml +++ b/lovelace/phone/girls-room.yaml @@ -184,7 +184,7 @@ cards: action: more-info hold_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: light.black_bed_wled @@ -202,7 +202,7 @@ cards: action: more-info hold_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: light.white_bed_wled @@ -264,7 +264,7 @@ cards: name: All Songs tap_action: action: call-service - action: script.all_kids_youtube_music + service: script.all_kids_youtube_music service_data: {} target: {} primary_info: name @@ -276,7 +276,7 @@ cards: name: Goodnight Songs tap_action: action: call-service - action: script.goodnight_kids_youtube_music + service: script.goodnight_kids_youtube_music service_data: {} target: {} primary_info: name @@ -288,7 +288,7 @@ cards: name: "Off" tap_action: action: call-service - action: homeassistant.turn_off + service: homeassistant.turn_off service_data: {} target: entity_id: media_player.ytube_music_player @@ -319,13 +319,13 @@ cards: primary: Black Bed double_tap_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: switch.black_bed_force_occupancy hold_action: action: call-service - action: button.press + service: button.press service_data: {} target: entity_id: button.black_bed_manual_tare diff --git a/lovelace/phone/home.yaml b/lovelace/phone/home.yaml index d45e0ca..5bc1a06 100644 --- a/lovelace/phone/home.yaml +++ b/lovelace/phone/home.yaml @@ -292,7 +292,7 @@ cards: - type: vertical-stack cards: - type: custom:mushroom-title-card - title: Upstairs + title: Private - type: horizontal-stack cards: - type: custom:mushroom-template-card @@ -310,6 +310,21 @@ cards: icon_color: "{{iif(is_state('light.nursery_hue','on'),'yellow')}}" multiline_secondary: true layout: vertical + - type: custom:mushroom-template-card + primary: Boy's Room + icon: mdi:earth + entity: light.boys_room_hue + tap_action: + action: navigate + navigation_path: boys-room + hold_action: + action: toggle + secondary: |- + {{states('sensor.boys_room_multisensor_air_temperature')}}°F + {{states('sensor.boys_room_multisensor_humidity')}}% + icon_color: "{{iif(is_state('light.boys_room_hue','on'),'yellow')}}" + multiline_secondary: true + layout: vertical - type: custom:mushroom-template-card primary: Master Bedroom icon: mdi:bed-king @@ -319,15 +334,16 @@ cards: navigation_path: master-bedroom hold_action: action: toggle - secondary: >- + secondary: |- {{states('sensor.master_bedroom_multisensor_air_temperature')}}°F - {{states('sensor.master_bedroom_multisensor_humidity')}}% icon_color: "{{iif(is_state('light.master_bedroom_hue','on'),'yellow')}}" multiline_secondary: true layout: vertical + - type: horizontal-stack + cards: - type: custom:mushroom-template-card - primary: Master Bathroom + primary: Bathroom icon: mdi:shower entity: light.master_bathroom_hue tap_action: @@ -338,9 +354,43 @@ cards: secondary: |- {{states('sensor.master_bathroom_thermostat_temperature')}}°F {{states('sensor.master_bathroom_thermostat_humidity')}}% - icon_color: "{{iif(is_state('light.master_bathroom_hue','on'),'yellow')}}" + icon_color: "{{iif(is_state('light.master_bathroom','on'),'yellow')}}" multiline_secondary: true layout: vertical + - type: custom:mushroom-template-card + primary: Utility Room + icon: mdi:washing-machine + entity: light.utility_room_vanity + tap_action: + action: navigate + navigation_path: utility-room + hold_action: + action: toggle + secondary: |- + {{states('sensor.utility_room_thermostat_temperature')}}°F + {{states('sensor.utility_room_thermostat_humidity')}}% + icon_color: "{{iif(is_state('light.utility_room_vanity','on'),'yellow')}}" + multiline_secondary: true + layout: vertical + - type: custom:mushroom-template-card + primary: Furnace Room + icon: mdi:hvac + entity: light.furnace_room + tap_action: + action: navigate + navigation_path: furnace-room + hold_action: + action: toggle + secondary: |- + {{states('sensor.furnace_room_thermostat_temperature')}}°F + {{states('sensor.furnace_room_thermostat_humidity')}}% + icon_color: "{{iif(is_state('light.furnace_room','on'),'yellow')}}" + multiline_secondary: true + layout: vertical + - type: vertical-stack + cards: + - type: custom:mushroom-title-card + title: Public - type: horizontal-stack cards: - type: custom:mushroom-template-card @@ -388,6 +438,53 @@ cards: icon_color: "{{iif(is_state('light.dining_room_switch','on'),'yellow')}}" multiline_secondary: true layout: vertical + - type: horizontal-stack + cards: + - type: custom:mushroom-template-card + primary: Computer Area + icon: mdi:desktop-classic + entity: light.computer_area_hue + tap_action: + action: navigate + navigation_path: computer-area + hold_action: + action: toggle + secondary: >- + {{states('sensor.computer_area_multisensor_air_temperature')}}°F + {{states('sensor.computer_area_multisensor_humidity')}}% + icon_color: "{{iif(is_state('light.computer_area_hue','on'),'yellow')}}" + multiline_secondary: true + layout: vertical + - type: custom:mushroom-template-card + primary: Great Room + icon: mdi:microsoft-xbox-controller + entity: light.great_room_hue + tap_action: + action: navigate + navigation_path: great-room + hold_action: + action: toggle + secondary: |- + {{states('sensor.great_room_multisensor_air_temperature')}}°F + {{states('sensor.great_room_multisensor_humidity')}}% + icon_color: "{{iif(is_state('light.great_room_hue','on'),'yellow')}}" + multiline_secondary: true + layout: vertical + - type: custom:mushroom-template-card + primary: Mancave + icon: mdi:human-male + entity: light.mancave + tap_action: + action: navigate + navigation_path: mancave + hold_action: + action: toggle + secondary: |- + {{states('sensor.mancave_thermostat_temperature')}}°F + {{states('sensor.mancave_thermostat_humidity')}}% + icon_color: "{{iif(is_state('light.mancave','on'),'yellow')}}" + multiline_secondary: true + layout: vertical - type: vertical-stack cards: - type: custom:mushroom-title-card @@ -486,102 +583,3 @@ cards: icon_color: "{{iif(is_state('light.deck','on'),'yellow')}}" multiline_secondary: true layout: vertical - - type: vertical-stack - cards: - - type: custom:mushroom-title-card - subtitle: Downstairs - - type: horizontal-stack - cards: - - type: custom:mushroom-template-card - primary: Computer Area - icon: mdi:desktop-classic - entity: light.computer_area_hue - tap_action: - action: navigate - navigation_path: computer-area - hold_action: - action: toggle - secondary: >- - {{states('sensor.computer_area_multisensor_air_temperature')}}°F - - {{states('sensor.computer_area_multisensor_humidity')}}% - icon_color: "{{iif(is_state('light.computer_area_hue','on'),'yellow')}}" - multiline_secondary: true - layout: vertical - - type: custom:mushroom-template-card - primary: Great Room - icon: mdi:microsoft-xbox-controller - entity: light.great_room_hue - tap_action: - action: navigate - navigation_path: great-room - hold_action: - action: toggle - secondary: |- - {{states('sensor.great_room_multisensor_air_temperature')}}°F - {{states('sensor.great_room_multisensor_humidity')}}% - icon_color: "{{iif(is_state('light.great_room_hue','on'),'yellow')}}" - multiline_secondary: true - layout: vertical - - type: custom:mushroom-template-card - primary: Utility Room - icon: mdi:washing-machine - entity: light.utility_room_vanity - tap_action: - action: navigate - navigation_path: utility-room - hold_action: - action: toggle - secondary: |- - {{states('sensor.utility_room_thermostat_temperature')}}°F - {{states('sensor.utility_room_thermostat_humidity')}}% - icon_color: "{{iif(is_state('light.utility_room_vanity','on'),'yellow')}}" - multiline_secondary: true - layout: vertical - - type: horizontal-stack - cards: - - type: custom:mushroom-template-card - primary: Boy's Room - icon: mdi:earth - entity: light.boys_room_hue - tap_action: - action: navigate - navigation_path: boys-room - hold_action: - action: toggle - secondary: |- - {{states('sensor.boys_room_multisensor_air_temperature')}}°F - {{states('sensor.boys_room_multisensor_humidity')}}% - icon_color: "{{iif(is_state('light.boys_room_hue','on'),'yellow')}}" - multiline_secondary: true - layout: vertical - - type: custom:mushroom-template-card - primary: Mancave - icon: mdi:human-male - entity: light.mancave - tap_action: - action: navigate - navigation_path: mancave - hold_action: - action: toggle - secondary: |- - {{states('sensor.mancave_thermostat_temperature')}}°F - {{states('sensor.mancave_thermostat_humidity')}}% - icon_color: "{{iif(is_state('light.mancave','on'),'yellow')}}" - multiline_secondary: true - layout: vertical - - type: custom:mushroom-template-card - primary: Furnace Room - icon: mdi:hvac - entity: light.furnace_room - tap_action: - action: navigate - navigation_path: furnace-room - hold_action: - action: toggle - secondary: |- - {{states('sensor.furnace_room_thermostat_temperature')}}°F - {{states('sensor.furnace_room_thermostat_humidity')}}% - icon_color: "{{iif(is_state('light.furnace_room','on'),'yellow')}}" - multiline_secondary: true - layout: vertical diff --git a/lovelace/phone/lights.yaml b/lovelace/phone/lights.yaml index 11966ac..a9bdf97 100644 --- a/lovelace/phone/lights.yaml +++ b/lovelace/phone/lights.yaml @@ -18,7 +18,7 @@ cards: use_light_color: false tap_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: input_boolean.nursery_occupied @@ -43,7 +43,7 @@ cards: 'yellow') }} tap_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: input_boolean.nursery_light_cycle @@ -62,7 +62,7 @@ cards: action: more-info hold_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: light.black_bed_wled @@ -79,7 +79,7 @@ cards: action: more-info hold_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: light.white_bed_wled @@ -109,7 +109,7 @@ cards: 'yellow') }} tap_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: input_boolean.front_room_light_cycle @@ -207,7 +207,7 @@ cards: 'on'), 'yellow') }} tap_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: input_boolean.computer_area_light_cycle @@ -237,7 +237,7 @@ cards: 'yellow') }} tap_action: action: call-service - action: homeassistant.toggle + service: homeassistant.toggle service_data: {} target: entity_id: input_boolean.great_room_light_cycle diff --git a/lovelace/phone/media.yaml b/lovelace/phone/media.yaml index 3335b08..27b808a 100644 --- a/lovelace/phone/media.yaml +++ b/lovelace/phone/media.yaml @@ -150,7 +150,7 @@ sections: value: false tap_action: action: call-service - action: ytube_music_player.call_method + service: ytube_music_player.call_method service_data: entity_id: media_player.ytube_music_player command: rate_track diff --git a/lovelace/phone/plants.yaml b/lovelace/phone/plants.yaml index 6a58676..28d4eb8 100644 --- a/lovelace/phone/plants.yaml +++ b/lovelace/phone/plants.yaml @@ -181,14 +181,14 @@ cards: name: 5 Minute Test tap_action: action: call-service - action: opensprinkler.run + service: opensprinkler.run data: entity_id: switch.5_minute_test_program_enabled - entity: binary_sensor.full_run_program_running name: Full Run tap_action: action: call-service - action: opensprinkler.run + service: opensprinkler.run data: entity_id: switch.full_run_program_enabled - entity: switch.morning_program_enabled @@ -203,14 +203,14 @@ cards: name: Front Yard Fun tap_action: action: call-service - action: opensprinkler.run + service: opensprinkler.run data: entity_id: switch.front_yard_fun_program_enabled - entity: binary_sensor.back_yard_fun_program_running name: Back Yard Fun tap_action: action: call-service - action: opensprinkler.run + service: opensprinkler.run data: entity_id: switch.back_yard_fun_program_enabled columns: 2 diff --git a/lovelace/raw-cameras/back-yard-card.yaml b/lovelace/raw-cameras/back-yard-card.yaml index eada76d..735c4f3 100644 --- a/lovelace/raw-cameras/back-yard-card.yaml +++ b/lovelace/raw-cameras/back-yard-card.yaml @@ -1,6 +1,6 @@ type: custom:advanced-camera-card cameras: - - camera_entity: camera.frigate_cam14 + - camera_entity: camera.frigate_cam12 live_provider: go2rtc go2rtc: modes: diff --git a/lovelace/raw-cameras/outdoor-camera-card.yaml b/lovelace/raw-cameras/outdoor-camera-card.yaml index c6679b5..a1f6063 100644 --- a/lovelace/raw-cameras/outdoor-camera-card.yaml +++ b/lovelace/raw-cameras/outdoor-camera-card.yaml @@ -7,13 +7,13 @@ cameras: modes: - webrtc stream: rtsp_cam04_sub - - camera_entity: camera.frigate_cam14 - title: Back Yard - live_provider: go2rtc - go2rtc: - modes: - - webrtc - stream: rtsp_cam14_sub + # - camera_entity: camera.frigate_cam14 + # title: Back Yard + # live_provider: go2rtc + # go2rtc: + # modes: + # - webrtc + # stream: rtsp_cam14_sub - camera_entity: camera.frigate_cam18 title: Front Yard live_provider: go2rtc diff --git a/lovelace/stretch-cameras/back-yard-card.yaml b/lovelace/stretch-cameras/back-yard-card.yaml index bee10af..b1bc869 100644 --- a/lovelace/stretch-cameras/back-yard-card.yaml +++ b/lovelace/stretch-cameras/back-yard-card.yaml @@ -14,7 +14,7 @@ cards: enabled: false style: none cameras: - - camera_entity: camera.frigate_cam14 + - camera_entity: camera.frigate_cam12 live_provider: go2rtc id: frigate-cam14 capabilities: diff --git a/lovelace/view-charts.yaml b/lovelace/view-charts.yaml index 5b598dd..298fa0b 100644 --- a/lovelace/view-charts.yaml +++ b/lovelace/view-charts.yaml @@ -140,25 +140,25 @@ cards: # name: Hassio # tap_action: # action: call-service - # action: homeassistant.restart + # service: homeassistant.restart # - entity: zone.home # icon: mdi:cogs # name: Automation # tap_action: # action: call-service - # action: automation.reload + # service: automation.reload # - entity: zone.home # icon: mdi:script-text # name: Script # tap_action: # action: call-service - # action: script.reload + # service: script.reload # - entity: zone.home # icon: mdi:group # name: Groups # tap_action: # action: call-service - # action: group.reload + # service: group.reload # - type: vertical-stack # cards: diff --git a/lovelace/view-ha-floorplan.yaml b/lovelace/view-ha-floorplan.yaml index 0439c8b..592e494 100644 --- a/lovelace/view-ha-floorplan.yaml +++ b/lovelace/view-ha-floorplan.yaml @@ -425,6 +425,27 @@ cards: return "temp-unknown"; ' + # The HVAC Delta can be positive or negative, depending on if the furnace, heat pump, or ac is running + - entities: + - sensor.hvac_multisensor_delta + # An example of rounding up a number, i.e. a temperature of 90.1 becomes 91 + text_template: '${entity.state ? Math.ceil(entity.state) : "undefined"} F' + class_template: ' + var temp = parseFloat(entity.state.replace("°", "")); + if (temp < -30) + return "temp-freeze"; + else if (temp < -20) + return "temp-low"; + else if (temp < 10) + return "temp-medium"; + else if (temp < 30) + return "temp-high"; + else if (temp >= 100) + return "temp-hot"; + else + return "hidden-entity"; + ' + - entities: - sensor.kitchen_fridge_thermostat_temperature text_template: '${entity.state ? Math.floor(entity.state) : "unknown"}' @@ -547,7 +568,8 @@ cards: ' - entities: - - sensor.hvac_multisensor_salt_level_in_bags + - sensor.water_softener_multisensor_salt_level_in_bags + text_template: '${entity.state ? Math.floor(entity.state) : "undefined"}' class_template: ' var bags = parseFloat(entity.state); if (bags > 4) @@ -729,7 +751,7 @@ cards: - binary_sensor.storage_room_door_contact - binary_sensor.mancave_door_contact - binary_sensor.boys_room_door_contact - - binary_sensor.hvac_multisensor_door + - binary_sensor.water_softener_multisensor_door #- binary_sensor.furnace_room_door_contact - binary_sensor.utility_room_door_contact states: diff --git a/lovelace/view-inputs.yaml b/lovelace/view-inputs.yaml index 2307843..c758090 100644 --- a/lovelace/view-inputs.yaml +++ b/lovelace/view-inputs.yaml @@ -151,7 +151,7 @@ cards: - entity: input_boolean.master_bedroom_asleep tap_action: action: toggle - - entity: input_boolean.nursery_asleep + - entity: input_boolean.girls_room_asleep tap_action: action: toggle diff --git a/lovelace/view-people.yaml b/lovelace/view-people.yaml index 8faa7db..d25b747 100644 --- a/lovelace/view-people.yaml +++ b/lovelace/view-people.yaml @@ -17,7 +17,7 @@ cards: camera_image: camera.clint tap_action: action: call-service - action: input_boolean.toggle + service: input_boolean.toggle service_data: entity_id: input_boolean.lovelace_clint_more - type: conditional @@ -58,7 +58,7 @@ cards: camera_image: camera.emmett tap_action: action: call-service - action: input_boolean.toggle + service: input_boolean.toggle service_data: entity_id: input_boolean.lovelace_emmett_more - type: conditional @@ -94,7 +94,7 @@ cards: camera_image: camera.bridget tap_action: action: call-service - action: input_boolean.toggle + service: input_boolean.toggle service_data: entity_id: input_boolean.lovelace_bridget_more - type: conditional diff --git a/www/floorplan/fullsized_floorplan.svg b/www/floorplan/fullsized_floorplan.svg index f1f33b9..60013db 100644 --- a/www/floorplan/fullsized_floorplan.svg +++ b/www/floorplan/fullsized_floorplan.svg @@ -38,9 +38,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.028284271" - inkscape:cx="61076.349" - inkscape:cy="43045.126" + inkscape:zoom="0.079999999" + inkscape:cx="66018.751" + inkscape:cy="37168.75" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -1605,14 +1605,14 @@ style="stroke-width:0.012145" transform="scale(-1)" /> + inkscape:label="binary_sensor.water_softener_multisensor_door" /> - inkscape:label="light.front_porch_overhead" />