diff --git a/automations/climate/hvac_fan_on.yaml b/automations/climate/hvac_fan_on.yaml index b279c4b..5c11154 100644 --- a/automations/climate/hvac_fan_on.yaml +++ b/automations/climate/hvac_fan_on.yaml @@ -48,11 +48,11 @@ condition: # Are the internal sensors above 67? # This is mainly to ensure those sensors are working - condition: numeric_state - entity_id: sensor.hvac_multisensor_return + entity_id: sensor.hvac_return_temperature above: 50 - condition: numeric_state - entity_id: sensor.hvac_multisensor_supply + entity_id: sensor.hvac_supply_temperature above: 50 # Is the fan currently off? diff --git a/automations/rooms/boys_room/boys_room_lights_to_on.yaml b/automations/rooms/boys_room/boys_room_lights_to_on.yaml index 10cad23..74d78f9 100644 --- a/automations/rooms/boys_room/boys_room_lights_to_on.yaml +++ b/automations/rooms/boys_room/boys_room_lights_to_on.yaml @@ -11,6 +11,12 @@ triggers: - input_select.boys_room_mode - input_select.automatic_light_profile + - trigger: state + id: light_level + entity_id: binary_sensor.boys_room_naturally_lit + from: "on" + to: "off" + - trigger: state id: occupied entity_id: @@ -18,17 +24,6 @@ triggers: - input_boolean.boys_room_occupied to: "on" - # - platform: state - # id: motion - # entity_id: group.boys_room_motion - # to: "on" - - - trigger: state - id: light_level - entity_id: binary_sensor.boys_room_naturally_lit - from: "on" - to: "off" - condition: - alias: "Home is occupied" condition: state diff --git a/automations/rooms/girls_room/girls_room_lights_to_on.yaml b/automations/rooms/girls_room/girls_room_lights_to_on.yaml index 217c169..80de01a 100644 --- a/automations/rooms/girls_room/girls_room_lights_to_on.yaml +++ b/automations/rooms/girls_room/girls_room_lights_to_on.yaml @@ -24,11 +24,6 @@ trigger: - binary_sensor.nursery_occupied to: "on" - # - platform: state - # id: motion - # entity_id: group.nursery_motion - # to: "on" - condition: - alias: "Home is occupied" condition: state diff --git a/components/binary_sensors/template.yaml b/components/binary_sensors/template.yaml index e7d01a5..973907f 100644 --- a/components/binary_sensors/template.yaml +++ b/components/binary_sensors/template.yaml @@ -299,9 +299,9 @@ sensors: {% if is_state('binary_sensor.hvac_delta_sensors_unavailable','on') %} {{'false'}} {% else %} - {% if is_state_attr('climate.thermostat', 'hvac_action', 'cooling') and states('sensor.hvac_multisensor_delta') | int(default=0) >= -5 %} + {% if is_state_attr('climate.thermostat', 'hvac_action', 'cooling') and states('sensor.hvac_delta_temperature') | int(default=0) >= -5 %} {{'true'}} - {% elif is_state_attr('climate.thermostat', 'hvac_action', 'heating') and states('sensor.hvac_multisensor_delta') | int(default=0) <= 5 %} + {% elif is_state_attr('climate.thermostat', 'hvac_action', 'heating') and states('sensor.hvac_delta_temperature') | int(default=0) <= 5 %} {{'true'}} {% else %} {{'false'}} @@ -329,15 +329,15 @@ sensors: unique_id: templatebinarysensor.hvac_delta_temperature_good friendly_name: HVAC Delta Temperature Good value_template: >- - {% if states("sensor.hvac_multisensor_supply") | string != "unknown" and states("sensor.hvac_multisensor_return") | string != "unknown" %} + {% if states("sensor.hvac_supply_temperature") | string != "unknown" and states("sensor.hvac_return_temperature") | string != "unknown" %} {% if states('sensor.hvac_action') | string == 'cooling' and as_timestamp(now())-(as_timestamp(states.sensor.hvac_action.last_changed))|round(1) > 300 %} - {% if states('sensor.hvac_multisensor_delta') | float(default=0) < -10 %} + {% if states('sensor.hvac_delta_temperature') | float(default=0) < -10 %} {{ 'true' }} {% else %} {{ 'false' }} {% endif %} {% elif states('sensor.hvac_action') | string == 'heating' and as_timestamp(now())-(as_timestamp(states.sensor.hvac_action.last_changed))|round(1) > 300 %} - {% if states('sensor.hvac_multisensor_delta') | float(default=0) > 10 %} + {% if states('sensor.hvac_delta_temperature') | float(default=0) > 10 %} {{ 'true' }} {% else %} {{ 'false' }} @@ -352,7 +352,7 @@ sensors: delay_on: minutes: 5 value_template: >- - {% if states("sensor.hvac_multisensor_supply") | string == 'unknown' or states("sensor.hvac_multisensor_return") | string == 'unknown' or states("sensor.hvac_multisensor_supply") | string == 'unavailable' or states("sensor.hvac_multisensor_return") | string == 'unavailable' %} + {% if states("sensor.hvac_supply_temperature") | string == 'unknown' or states("sensor.hvac_return_temperature") | string == 'unknown' or states("sensor.hvac_supply_temperature") | string == 'unavailable' or states("sensor.hvac_return_temperature") | string == 'unavailable' %} {{ 'true' }} {% else %} {{ 'false' }} diff --git a/components/packages/batteries/zigbee_batteries.yaml b/components/packages/batteries/zigbee_batteries.yaml index deaf422..9b9f1ea 100644 --- a/components/packages/batteries/zigbee_batteries.yaml +++ b/components/packages/batteries/zigbee_batteries.yaml @@ -15,7 +15,7 @@ sensor: name: Lowest Thermostat Battery type: min entity_ids: - - sensor.boys_room_thermostat_battery + - sensor.extra_thermostat_battery - sensor.front_room_thermostat_battery - sensor.furnace_room_thermostat_battery - sensor.mancave_thermostat_battery diff --git a/components/packages/databases.yaml b/components/packages/databases.yaml index c41d83f..3f36acc 100644 --- a/components/packages/databases.yaml +++ b/components/packages/databases.yaml @@ -187,7 +187,7 @@ logbook: - sensor.time - sensor.time_date - sensor.time_utc - - sensor.hvac_multisensor_delta + - sensor.hvac_delta_temperature - sensor.master_bed_person_count - sensor.lights_on_count diff --git a/components/packages/hvac_stats.yaml b/components/packages/hvac_stats.yaml index 0724ca0..92e42ff 100644 --- a/components/packages/hvac_stats.yaml +++ b/components/packages/hvac_stats.yaml @@ -68,7 +68,7 @@ sensor: entity_ids: - sensor.computer_area_multisensor_air_temperature - sensor.mancave_thermostat_temperature - - sensor.boys_room_thermostat_temperature + - sensor.boys_room_multisensor_air_temperature - sensor.great_room_multisensor_air_temperature - sensor.furnace_room_thermostat_temperature @@ -78,7 +78,7 @@ sensor: entity_ids: - sensor.computer_area_multisensor_air_temperature - sensor.mancave_thermostat_temperature - - sensor.boys_room_thermostat_temperature + - sensor.boys_room_multisensor_air_temperature - sensor.great_room_multisensor_air_temperature # - platform: min_max @@ -87,7 +87,7 @@ sensor: # entity_ids: # - sensor.computer_area_multisensor_air_temperature # - sensor.mancave_thermostat_temperature - # - sensor.boys_room_thermostat_temperature + # - sensor.boys_room_multisensor_air_temperature # - sensor.great_room_multisensor_air_temperature - platform: min_max @@ -97,7 +97,7 @@ sensor: - sensor.computer_area_multisensor_humidity - sensor.great_room_multisensor_humidity - sensor.mancave_thermostat_humidity - - sensor.boys_room_thermostat_humidity + - sensor.boys_room_multisensor_humidity - platform: min_max name: Downstairs Min Humidity @@ -106,7 +106,7 @@ sensor: - sensor.computer_area_multisensor_humidity - sensor.great_room_multisensor_humidity - sensor.mancave_thermostat_humidity - - sensor.boys_room_thermostat_humidity + - sensor.boys_room_multisensor_humidity - platform: min_max name: Downstairs Mean Humidity @@ -115,7 +115,7 @@ sensor: - sensor.computer_area_multisensor_humidity - sensor.great_room_multisensor_humidity - sensor.mancave_thermostat_humidity - - sensor.boys_room_thermostat_humidity + - sensor.boys_room_multisensor_humidity - platform: history_stats name: AC Cooling Time Today diff --git a/components/packages/hygrostats.yaml b/components/packages/hygrostats.yaml index 10a2266..8da7ed4 100644 --- a/components/packages/hygrostats.yaml +++ b/components/packages/hygrostats.yaml @@ -13,7 +13,7 @@ binary_sensor: - platform: generic_hygrostat name: Utility Room Hygrostat - sensor: sensor.utility_room_thermostat_humidity # Source humidity sensor + sensor: sensor.utility_room_multisensor_relative_humidity # Source humidity sensor #attribute: humidity # Optional use sensor attribute instead of state. delta_trigger: 5 # Optional humidity swing to detect. Default = 3 target_offset: 10 # Optional dehumidification target offset. Default = 3 diff --git a/esphome/archive/hvac-multisensor-old.yaml b/esphome/archive/hvac-multisensor-old.yaml new file mode 100644 index 0000000..29083d1 --- /dev/null +++ b/esphome/archive/hvac-multisensor-old.yaml @@ -0,0 +1,236 @@ +# 3v3 en svp sun 34 35 32 33 25 26 27 14 12 gnd 13 sd2 sd3 gnd 5v +substitutions: + devicename: hvac-multisensor + entity_name: hvac_multisensor + friendly_name: HVAC MultiSensor + comment: Clever MultiSensor + platform: ESP32 + 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: GPIO26 + +# For the ultrasonic sensor + trigger_pin: GPIO16 + echo_pin: GPIO13 + + #mdc_pin: GPIO23 + #mdio_pin: GPIO18 + #clk_mode: GPIO17_OUT + #power_pin: GPIO5 + +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: + +globals: + - id: oled_enabled + 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: "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} + +i2c: + sda: ${sda_pin} + scl: ${scl_pin} + frequency: 800kHz + +sensor: + - platform: dallas_temp + address: 0xB33C01B607798528 + name: "Return" + id: hvac_return + icon: mdi:home-thermometer-outline + update_interval: 10s + filters: + - lambda: return x * (9.0/5.0) + 32.0; + unit_of_measurement: "°F" + state_class: measurement + + - platform: dallas_temp + address: 0x0F3C01B6070C1328 + name: "Supply" + id: hvac_supply + icon: mdi:thermostat + update_interval: 10s + filters: + - lambda: return x * (9.0/5.0) + 32.0; + unit_of_measurement: "°F" + state_class: measurement + + - platform: dallas_temp + address: 0xFA3C01B607005B28 + name: "Ambient" + id: ambient + icon: mdi:home-thermometer + update_interval: 10s + filters: + - lambda: return x * (9.0/5.0) + 32.0; + unit_of_measurement: "°F" + state_class: measurement + + - platform: template + name: "Delta" + id: hvac_delta + icon: mdi:thermometer-lines + lambda: |- + return (id(hvac_supply).state - id(hvac_return).state); + update_interval: 10s + unit_of_measurement: "°F" + state_class: measurement + filters: + - 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); + +binary_sensor: + - platform: gpio + name: "Door" + device_class: door + pin: ${door_pin} + filters: + - invert: + +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/hvac-multisensor.yaml b/esphome/archive/hvac-multisensor.yaml index 29083d1..39a8680 100644 --- a/esphome/archive/hvac-multisensor.yaml +++ b/esphome/archive/hvac-multisensor.yaml @@ -5,32 +5,48 @@ 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 Ultrasonic Sensor + trigger_pin: GPIO14 + echo_pin: GPIO16 + # 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 +# For additional devices + passive_buzzer_pin: GPIO26 + one_wire_pin: GPIO17 + moisture_pin: GPIO33 + door_pin: GPIO34 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,84 +54,237 @@ 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: - -globals: - - id: oled_enabled - 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/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 - # size: 20 - - # - file: "gfonts://Material+Symbols+Outlined" - # id: icons_50 - # size: 50 - # glyphs: ["\U0000e425"] # mdi-timer 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 + - id: bus_a + 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 + +binary_sensor: + - platform: gpio + name: "Door" + device_class: door + pin: + number: ${door_pin} + inverted: True sensor: + - platform: ultrasonic + trigger_pin: ${trigger_pin} + echo_pin: ${echo_pin} + name: "Ultrasonic Sensor" + update_interval: 1s + + - platform: bme280_i2c + i2c_id: bus_a + address: 0x76 + update_interval: 10s + temperature: + name: "BME280 76A Temperature" + pressure: + name: "BME280 76A Pressure" + humidity: + name: "BME280 76A Humidity" + - platform: dallas_temp - address: 0xB33C01B607798528 - name: "Return" - id: hvac_return - icon: mdi:home-thermometer-outline + address: 0x5a3c01d6078a2e28 + name: "Probe 1" + id: probe1 + icon: mdi:thermostat 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; + - clamp: + min_value: 0.0 + max_value: 150.0 unit_of_measurement: "°F" state_class: measurement - platform: dallas_temp - address: 0x0F3C01B6070C1328 - name: "Supply" - id: hvac_supply + address: 0x6b3c01d6077bbb28 + name: "Probe 2" + id: probe2 icon: mdi:thermostat update_interval: 10s filters: - lambda: return x * (9.0/5.0) + 32.0; + - clamp: + min_value: 0.0 + max_value: 150.0 unit_of_measurement: "°F" state_class: measurement - platform: dallas_temp - address: 0xFA3C01B607005B28 - name: "Ambient" - id: ambient - icon: mdi:home-thermometer + address: 0x2a3c01d6073e0728 + name: "Probe 3" + id: probe3 + icon: mdi:thermostat update_interval: 10s filters: - lambda: return x * (9.0/5.0) + 32.0; + - clamp: + min_value: 0.0 + max_value: 150.0 unit_of_measurement: "°F" state_class: measurement @@ -124,113 +293,409 @@ sensor: id: hvac_delta icon: mdi:thermometer-lines lambda: |- - return (id(hvac_supply).state - id(hvac_return).state); + return (id(probe1).state - id(probe2).state); update_interval: 10s unit_of_measurement: "°F" state_class: measurement filters: + - lambda: 'return round( x * 100.0) / 100.0;' + - clamp: + min_value: -100.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 + # Uses i2c + - platform: ft63x6 + i2c_id: bus_a + 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/common/olimex-evb.yaml b/esphome/common/olimex_evb.yaml similarity index 100% rename from esphome/common/olimex-evb.yaml rename to esphome/common/olimex_evb.yaml diff --git a/esphome/common/olimex-poe.yaml b/esphome/common/olimex_poe.yaml similarity index 100% rename from esphome/common/olimex-poe.yaml rename to esphome/common/olimex_poe.yaml diff --git a/esphome/everything-presence-lite-8fa4fc.yaml b/esphome/everything-presence-lite-8fa4fc.yaml index 6cc3de4..e4464a8 100644 --- a/esphome/everything-presence-lite-8fa4fc.yaml +++ b/esphome/everything-presence-lite-8fa4fc.yaml @@ -1,3 +1,56 @@ +# DFRobot Connector (top) +# [1][2][3][4][5][6] + +# 1: 5V +# 2: GND +# 3: GPIO19 / pin38 +# 4: GPIO18 / pin35 +# 5: GPIO17 / pin27 < in use by LD2450 | UART TX +# 6: GPIO16 / pin25 < in use by LD2450 | UART RX + +# LD2410 connector (bottom) +# [1][2][3][4][5] + +# 1: GPIO16 / pin25 +# 2: GPIO17 / pin27 +# 3: GPIO18 / pin35 +# 4: GND +# 5: 5V + +# Debug connector (next to 5V connector) +# [1][2][3] +# [4][5][6] + +# 1: GPIO32 / pin12 +# 2: GPIO26 / pin15 +# 3: 3.3V +# 4: GPIO25 / pin14 +# 5: GPIO27 / pin16 +# 6: GND + + +# i2c: +# - id: bus_b +# sda: 26 +# scl: 27 +# scan: true + +# sensor: +# - platform: scd4x +# i2c_id: bus_b +# id: scd40 +# measurement_mode: low_power_periodic +# co2: +# name: "CO2" +# id: "co2" +# filters: +# - or: +# - delta: 5% +# - delta: 5 +# automatic_self_calibration: false + + + substitutions: name: everything-presence-lite-8fa4fc friendly_name: Everything Presence Great Room @@ -18,4 +71,16 @@ wifi: binary_sensor: - platform: status - name: "Status" \ No newline at end of file + name: "Status" + +# sensor: +# - platform: bme280_i2c +# i2c_id: bus_b +# # address: 0x76 +# update_interval: 10s +# temperature: +# name: "Temperature" +# pressure: +# name: "Pressure" +# humidity: +# name: "Humidity" \ No newline at end of file diff --git a/esphome/furnace-room-multisensor.yaml b/esphome/furnace-room-multisensor.yaml new file mode 100644 index 0000000..560e86b --- /dev/null +++ b/esphome/furnace-room-multisensor.yaml @@ -0,0 +1,198 @@ +substitutions: + devicename: furnace-room-multisensor + entity_name: furnace_room_multisensor + friendly_name: Furnace Room MultiSensor + comment: Clever MultiSensor + board: nodemcuv2 + static_ip: !secret furnace-room-multisensor-ip + + +# For the reed switches + door: 35 + moisture: 36 + +# For the ultrasonic sensor + trigger: 14 + echo: 15 + +# Infrared Sensor + ir_tx: 12 + ir_rx: 39 + +# I2C Pins + i2c_sda: 13 + i2c_scl: 16 + +# For the ethernet adapter + ethernet_mdc_pin: 23 + ethernet_mdio_pin: 18 + ethernet_clk_pin: 0 + +# For the relays + relay1: 32 + relay2: 33 + +# Built-in button + button1: 34 + +# For the HVAC temperature sensors + one_wire: 17 + +one_wire: + - platform: gpio + pin: ${one_wire} + +esphome: + name: ${devicename} + friendly_name: ${friendly_name} + name_add_mac_suffix: false + +packages: + network: !include common/olimex_evb.yaml + device_base: !include common/device_base.yaml + + +# Included in common/olimex-evb.yaml +# esp32: +# board: esp32dev +# framework: +# type: esp-idf + +# Enable logging +logger: + +web_server: + port: 80 + version: 3 + include_internal: True + +# # Enable Home Assistant API +# api: +# encryption: +# key: "mupTLNBggWPdKHxBeY1yV47qXgyhVJUgIVVAvfGrZ40=" + +# ota: +# - platform: esphome +# password: "b43bd5c6f724d64a9bd4e92504830d8f" + +remote_receiver: + pin: ${ir_rx} + dump: all + +remote_transmitter: + pin: ${ir_tx} + carrier_duty_percent: 50% + +i2c: + sda: ${i2c_sda} + scl: ${i2c_scl} + scan: true + id: bus_a + +binary_sensor: + - platform: gpio + name: "ESP32-EVB button" + pin: ${button1} + + - platform: gpio + name: "Door" + device_class: door + filters: + - invert: + pin: + number: ${door} + # mode: INPUT_PULLUP + + - platform: gpio + name: "Moisture" + device_class: moisture + pin: + number: ${moisture} + # mode: INPUT_PULLUP + + +switch: + - platform: gpio + pin: ${relay1} + name: "Relay1" + + - platform: gpio + pin: ${relay2} + name: "Relay2" + +sensor: + - platform: ultrasonic + trigger_pin: ${trigger} + echo_pin: ${echo} + 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 \ No newline at end of file diff --git a/esphome/hvac-multisensor.yaml b/esphome/hvac-multisensor.yaml index bb38518..dcc7dc5 100644 --- a/esphome/hvac-multisensor.yaml +++ b/esphome/hvac-multisensor.yaml @@ -4,753 +4,107 @@ substitutions: entity_name: hvac_multisensor friendly_name: HVAC MultiSensor comment: Clever MultiSensor - platform: ESP32 - board: esp32-wroom-32d - variant: esp32 + platform: ESP8266 + board: d1_mini + #variant: esp32 # framework: esp-idf - framework: arduino + #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 - sda_pin: GPIO21 - scl_pin: GPIO22 - -# For i2c devices - sda2_pin: GPIO16 - scl2_pin: GPIO17 - - passive_buzzer_pin: GPIO26 - one_wire_pin: GPIO13 - 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} - variant: ${variant} - framework: - type: ${framework} +esp8266: + board: ${board} # 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: - -# globals: - # - id: oled_enabled - # 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: 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 - # size: 20 - - # - file: "gfonts://Material+Symbols+Outlined" - # id: icons_50 - # size: 50 - # glyphs: ["\U0000e425"] # mdi-timer - -# one_wire: -# - platform: gpio -# pin: -# number: ${one_wire_pin} -# mode: -# input: true -# pullup: true - -i2c: - - id: bus_a - sda: ${sda_pin} - scl: ${scl_pin} - #frequency: 800kHz - - - id: bus_b - sda: ${sda2_pin} - scl: ${scl2_pin} - -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 +one_wire: + - platform: gpio + pin: D5 sensor: - - platform: bme280_i2c - i2c_id: bus_a - address: 0x76 + - platform: dallas_temp + address: 0x5a3c01d6078a2e28 + name: "Probe 1" + id: probe1 + icon: mdi:thermostat update_interval: 10s - temperature: - name: "BME280 76A Temperature" - pressure: - name: "BME280 76A Pressure" - humidity: - name: "BME280 76A Humidity" + filters: + - lambda: |- + float val = x; + if (isnan(val)) { + val = 0.0; + } + return val * (9.0/5.0) + 32.0; + - clamp: + min_value: 0.0 + max_value: 150.0 + - or: + - throttle: 60s + - delta: 1.0 + unit_of_measurement: "°F" + state_class: measurement - - platform: bme280_i2c - i2c_id: bus_b - address: 0x76 + - platform: dallas_temp + address: 0x6b3c01d6077bbb28 + name: "Probe 2" + id: probe2 + icon: mdi:thermostat update_interval: 10s - temperature: - name: "BME280 76B Temperature" - pressure: - name: "BME280 76B Pressure" - humidity: - name: "BME280 76B Humidity" + filters: + - lambda: return x * (9.0/5.0) + 32.0; + - clamp: + min_value: 0.0 + max_value: 150.0 + - or: + - throttle: 60s + - delta: 1.0 + unit_of_measurement: "°F" + state_class: measurement - - platform: bme280_i2c - i2c_id: bus_a - address: 0x77 + - platform: dallas_temp + address: 0x2a3c01d6073e0728 + name: "Probe 3" + id: probe3 + icon: mdi:thermostat update_interval: 10s - temperature: - name: "BME280 77A Temperature" - pressure: - name: "BME280 77A Pressure" - humidity: - name: "BME280 77A Humidity" + filters: + - lambda: return x * (9.0/5.0) + 32.0; + - clamp: + min_value: 0.0 + max_value: 150.0 + - or: + - throttle: 60s + - delta: 1.0 + unit_of_measurement: "°F" + state_class: measurement - - platform: bme280_i2c - i2c_id: bus_b - address: 0x77 + - platform: template + name: "Delta" + id: hvac_delta + icon: mdi:thermometer-lines + lambda: |- + return round( (id(probe1).state - id(probe2).state) * 100.0) / 100.0; update_interval: 10s - temperature: - name: "BME280 77B Temperature" - pressure: - name: "BME280 77B Pressure" - humidity: - name: "BME280 77B Humidity" - - # - platform: dallas_temp - # address: 0xB33C01B607798528 - # name: "Return" - # id: hvac_return - # icon: mdi:home-thermometer-outline - # update_interval: 10s - # filters: - # - 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 - - # - platform: dallas_temp - # address: 0x0F3C01B6070C1328 - # name: "Supply" - # id: hvac_supply - # icon: mdi:thermostat - # 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 - - # - platform: dallas_temp - # address: 0xFA3C01B607005B28 - # name: "Ambient" - # id: ambient - # icon: mdi:home-thermometer - # 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 - - # - platform: template - # name: "Delta" - # id: hvac_delta - # icon: mdi:thermometer-lines - # lambda: |- - # return (id(hvac_supply).state - id(hvac_return).state); - # update_interval: 10s - # unit_of_measurement: "°F" - # state_class: measurement - # filters: - # - clamp: - # min_value: 0.0 - # max_value: 100.0 - # - or: - # - throttle: 60s - # - delta: 1.0 - -display: - - 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 - -touchscreen: - # - platform: ft5x06 - # Uses i2c - - platform: ft63x6 - i2c_id: bus_a - 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 - -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 + unit_of_measurement: "°F" + state_class: measurement + device_class: "" + accuracy_decimals: 1 + filters: + #- lambda: 'return round( (id(probe1).state - id(probe2).state) * 100.0) / 100.0;' + - clamp: + min_value: -100.0 + max_value: 100.0 + - or: + - throttle: 60s + - delta: 1.0 diff --git a/esphome/test-device-1.yaml b/esphome/test-device-1.yaml new file mode 100644 index 0000000..3619802 --- /dev/null +++ b/esphome/test-device-1.yaml @@ -0,0 +1,158 @@ +esphome: + name: test-device-1 + friendly_name: Test Device 1 + +esp32: + board: esp32dev + framework: + type: esp-idf + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "PySr6PXZw6crnoT/oQJC3hYyVnPlXi2OwF8CAuA1d1U=" + +ota: + - platform: esphome + password: "d9ccd2607c37bc67061f8f76971ec953" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Test-Device-1 Fallback Hotspot" + password: "ELfuAtKmRwOC" + +# For Ultrasonic Sensor +# trigger_pin: GPIO13 +# echo_pin: GPIO14 + +captive_portal: + +i2c: + - id: bus_a + sda: 21 + scl: 22 + scan: true + + - id: bus_b + sda: 32 + scl: 33 + scan: true + +sensor: + - platform: ultrasonic + update_interval: 1s + trigger_pin: GPIO13 + echo_pin: GPIO14 + name: "Ultrasonic Sensor" + + # - platform: bme280_i2c + # i2c_id: bus_a + # address: 0x76 + # update_interval: 10s + # temperature: + # name: "BME280 76A Temperature" + # pressure: + # name: "BME280 76A Pressure" + # humidity: + # name: "BME280 76A Humidity" + + # - platform: bme280_i2c + # i2c_id: bus_b + # address: 0x76 + # update_interval: 10s + # temperature: + # name: "BME280 76B Temperature" + # pressure: + # name: "BME280 76B Pressure" + # humidity: + # name: "BME280 76B Humidity" + + - platform: bme680 + i2c_id: bus_a + temperature: + name: "BME680 Temperature" + oversampling: 16x + pressure: + name: "BME680 Pressure" + humidity: + id: "humidity" + name: "BME680 Humidity" + gas_resistance: + id: "gas_resistance" + name: "BME680 Gas Resistance" + address: 0x77 + update_interval: 60s + - platform: template + name: "BME680 Indoor Air Quality" + id: iaq + icon: "mdi:gauge" + # calculation: comp_gas = log(R_gas[ohm]) + 0.04 log(Ohm)/%rh * hum[%rh] + lambda: |- + return log(id(gas_resistance).state) + 0.04 * id(humidity).state; + state_class: "measurement" + + +text_sensor: + - platform: template + name: "BME680 IAQ Classification" + icon: "mdi:checkbox-marked-circle-outline" + lambda: |- + if (int(id(iaq).state) <= 50) { + return {"Excellent"}; + } + else if (int(id(iaq).state) <= 100) { + return {"Good"}; + } + else if (int(id(iaq).state) <= 150) { + return {"Lightly polluted"}; + } + else if (int(id(iaq).state) <= 200) { + return {"Moderately polluted"}; + } + else if (int(id(iaq).state) <= 250) { + return {"Heavily polluted"}; + } + else if (int(id(iaq).state) <= 350) { + return {"Severely polluted"}; + } + else if (int(id(iaq).state) <= 500) { + return {"Extremely polluted"}; + } + else { + return {"unknown"}; + } + + +esp32_touch: + + +binary_sensor: + - platform: gpio + name: "Door" + device_class: door + pin: + number: 16 + mode: INPUT_PULLUP + inverted: True + + - platform: gpio + #threshold: 1000 + name: "Moisture" + device_class: moisture + pin: + number: 12 + mode: INPUT_PULLUP + inverted: True + + # - platform: esp32_touch + # threshold: 1000 + # name: "Moisture" + # device_class: moisture + # pin: 14 \ No newline at end of file diff --git a/esphome/utility-room-multisensor.yaml b/esphome/utility-room-multisensor.yaml new file mode 100644 index 0000000..a66a1c6 --- /dev/null +++ b/esphome/utility-room-multisensor.yaml @@ -0,0 +1,235 @@ +substitutions: + devicename: utility-room-multisensor + entity_name: utility_room_multisensor + friendly_name: Utility Room MultiSensor + comment: Clever MultiSensor + platform: ESP8266 + board: d1_mini + static_ip: !secret utility-room-multisensor-ip + +packages: + 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: + #level: VERBOSE + +web_server: + port: 80 + version: 3 + include_internal: True + +i2c: + - id: bus_a + sda: D2 + scl: D1 + +bme680_bsec: + i2c_id: bus_a + + # i2c address + # ----------- + # Common values are: + # - 0x76 + # - 0x77 + # Default: 0x76 + address: 0x77 + + # Temperature offset + # ------------------ + # Useful if device is in enclosure and reads too high + # Default: 0 + temperature_offset: 0 + + # IAQ calculation mode + # -------------------- + # Available options: + # - static (for fixed position devices) + # - mobile (for on person or other moveable devices) + # Default: static + iaq_mode: static + + # Sample rate + # ----------- + # This controls the sampling rate for gas-dependant sensors and will govern the interval + # at which the sensor heater is operated. + # By default this rate will also be used for temperature, pressure and humidity sensors + # but these can be overridden on a per-sensor level if required. + # + # Available options: + # - lp (low power - samples every 3 seconds) + # - ulp (ultra low power - samples every 5 minutes) + # Default: lp + sample_rate: lp + + # Interval at which to save BSEC state + # ------------------------------------ + # Default: 6h + state_save_interval: 6h + +sensor: + # - platform: bme680 + # i2c_id: bus_a + # address: 0x77 + # update_interval: 3s + # temperature: + # name: "Standard Temperature" + # oversampling: 16x + # device_class: temperature + # unit_of_measurement: "°C" + # web_server: + # sorting_weight: 10 + # pressure: + # name: "Standard Pressure" + # device_class: atmospheric_pressure + # unit_of_measurement: hPa + # web_server: + # sorting_weight: 20 + # humidity: + # id: "humidity" + # name: "Standard Humidity" + # device_class: humidity + # unit_of_measurement: "%" + # web_server: + # sorting_weight: 30 + # gas_resistance: + # id: "gas_resistance" + # name: "Standard Gas Resistance" + # unit_of_measurement: "Ω" + # web_server: + # sorting_weight: 40 + + # - platform: template + # name: "Standard Indoor Air Quality" + # id: iaq + # icon: "mdi:gauge" + # # calculation: comp_gas = log(R_gas[ohm]) + 0.04 log(Ohm)/%rh * hum[%rh] + # lambda: |- + # return log(id(gas_resistance).state) + 0.04 * id(humidity).state; + # state_class: "measurement" + # web_server: + # sorting_weight: 50 + + - platform: bme680_bsec + temperature: + # Temperature in °C + name: "Temperature" + id: temp + sample_rate: lp + unit_of_measurement: "°C" + web_server: + sorting_weight: 11 + filters: + - median + pressure: + # Pressure in hPa + name: "Pressure" + id: pressure + sample_rate: lp + unit_of_measurement: "hPa" + web_server: + sorting_weight: 21 + filters: + - median + humidity: + # Relative humidity % + id: humidity + name: "Relative Humidity" + sample_rate: lp + unit_of_measurement: "%" + web_server: + sorting_weight: 31 + filters: + - median + gas_resistance: + # Gas resistance in Ω + name: "Gas Resistance" + id: gas_resistance + unit_of_measurement: "Ω" + disabled_by_default: True + web_server: + sorting_weight: 41 + filters: + - median + iaq: + # Indoor air quality value + name: "Air Quality Index" + unit_of_measurement: "AQI" + id: iaq + web_server: + sorting_weight: 51 + filters: + - median + iaq_accuracy: + # IAQ accuracy as a numeric value of 0, 1, 2, 3 + name: "Numeric IAQ Accuracy" + id: iaq_accuracy + disabled_by_default: True + web_server: + sorting_weight: 71 + co2_equivalent: + # CO2 equivalent estimate in ppm + name: "CO2 Equivalent" + id: co2 + unit_of_measurement: "ppm" + web_server: + sorting_weight: 81 + filters: + - median + breath_voc_equivalent: + # Volatile organic compounds equivalent estimate in ppm + name: "Breath VOC Equivalent" + id: breath_voc + unit_of_measurement: "ppm" + web_server: + sorting_weight: 91 + filters: + - median + +text_sensor: + - platform: template + name: "IAQ Classification" + icon: "mdi:checkbox-marked-circle-outline" + web_server: + sorting_weight: 60 + lambda: |- + if (int(id(iaq).state) <= 50) { + return {"Excellent"}; + } + else if (int(id(iaq).state) <= 100) { + return {"Good"}; + } + else if (int(id(iaq).state) <= 150) { + return {"Lightly polluted"}; + } + else if (int(id(iaq).state) <= 200) { + return {"Moderately polluted"}; + } + else if (int(id(iaq).state) <= 250) { + return {"Heavily polluted"}; + } + else if (int(id(iaq).state) <= 350) { + return {"Severely polluted"}; + } + else if (int(id(iaq).state) <= 500) { + return {"Extremely polluted"}; + } + else { + return {"unknown"}; + } + + - platform: bme680_bsec + iaq_accuracy: + # IAQ accuracy as a text value of Stabilizing, Uncertain, Calibrating, Calibrated + name: "AQI Accuracy" + web_server: + sorting_weight: 61 \ No newline at end of file diff --git a/groups.yaml b/groups.yaml index cefda77..f54b967 100644 --- a/groups.yaml +++ b/groups.yaml @@ -50,7 +50,6 @@ boys_room_motion: entities: - binary_sensor.boys_room_motion_switch_motion_detection - binary_sensor.boys_room_multisensor_motion_detection - - binary_sensor.everything_presence_lite_8fa4fc_occupancy front_room_motion: name: Front Room Motion diff --git a/lovelace/details/view-batteries.yaml b/lovelace/details/view-batteries.yaml index ac37845..d6ff0a4 100644 --- a/lovelace/details/view-batteries.yaml +++ b/lovelace/details/view-batteries.yaml @@ -49,7 +49,7 @@ cards: - type: entities title: Thermostat Batteries entities: - - sensor.boys_room_thermostat_battery + - sensor.extra_thermostat_battery - sensor.front_room_thermostat_battery - sensor.furnace_room_thermostat_battery - sensor.mancave_thermostat_battery diff --git a/lovelace/details/view-hvac.yaml b/lovelace/details/view-hvac.yaml index 8e54e71..1fcdf81 100644 --- a/lovelace/details/view-hvac.yaml +++ b/lovelace/details/view-hvac.yaml @@ -128,7 +128,7 @@ sections: is_state('sensor.thermal_comfort_summer_scharlau_perception','slightly_uncomfortable') %} Slightly Uncomfy {% elif is_state('sensor.thermal_comfort_summer_scharlau_perception','moderately_uncomfortable') - %} Moderatly Uncomfy {% elif + %} Moderately Uncomfy {% elif is_state('sensor.thermal_comfort_summer_scharlau_perception','highly_uncomfortable') %} Highly Uncomfortable {% elif is_state('sensor.thermal_comfort_summer_scharlau_perception','outside_calculable_range') @@ -356,8 +356,8 @@ sections: %} Comfy {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','slightly_uncomfortable') %} Slightly Uncomfy {% elif - is_state('sensor.thermal_comfort_winter_scharlau_perception','moderatly_uncomfortable') - %} Moderatly Uncomfy {% elif + is_state('sensor.thermal_comfort_winter_scharlau_perception','moderately_uncomfortable') + %} Moderately Uncomfy {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','highly_uncomfortable') %} Highly Uncomfortable {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','outside_calculable_range') @@ -368,7 +368,7 @@ sections: %} mdi:snowflake-off {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','slightly_uncomfortable') %} mdi:snowflake {% elif - is_state('sensor.thermal_comfort_winter_scharlau_perception','moderatly_uncomfortable') + is_state('sensor.thermal_comfort_winter_scharlau_perception','moderately_uncomfortable') %} mdi:snowflake-thermometer {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','highly_uncomfortable') %} mdi:snowflake-alert {% elif @@ -380,7 +380,7 @@ sections: %} green {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','slightly_uncomfortable') %} yellow {% elif - is_state('sensor.thermal_comfort_winter_scharlau_perception','moderatly_uncomfortable') + is_state('sensor.thermal_comfort_winter_scharlau_perception','moderately_uncomfortable') %} orange {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','highly_uncomfortable') %} red {% elif diff --git a/lovelace/phone/furnace-room.yaml b/lovelace/phone/furnace-room.yaml index 1bbb1f9..948e61f 100644 --- a/lovelace/phone/furnace-room.yaml +++ b/lovelace/phone/furnace-room.yaml @@ -43,48 +43,93 @@ cards: - type: horizontal-stack cards: - type: custom:mushroom-entity-card - entity: light.hvac_multisensor_display_backlight - name: HVAC Display - icon: mdi:monitor + entity: binary_sensor.furnace_room_water_sensor_water_alarm_water_leak_detected + name: Leak + icon: mdi:water layout: vertical secondary_info: none - tap_action: - action: toggle + - type: glance + show_name: true + show_icon: false + show_state: true + title: Water Softener + columns: 3 + entities: + - entity: sensor.water_softener_multisensor_salt_level_in_bags + name: Salt (cm) + - entity: sensor.water_softener_multisensor_salt_level_in_cm + name: From Bottom (cm) + - entity: sensor.water_softener_multisensor_salt_level_from_top_in_cm + name: From Top (cm) - type: vertical-stack cards: - type: custom:mushroom-title-card subtitle: Sensors - - type: horizontal-stack + - type: vertical-stack cards: - - type: custom:mushroom-entity-card - entity: binary_sensor.heat_pump - secondary_info: none - layout: vertical - - type: custom:mushroom-entity-card - entity: binary_sensor.furnace - layout: vertical - secondary_info: none - - type: horizontal-stack - cards: - - type: custom:mushroom-entity-card - entity: group.furnace_room_motion - name: Motion - layout: vertical - secondary_info: none - - type: horizontal-stack - cards: - - hours_to_show: 24 - graph: line - type: sensor - entity: sensor.hvac_multisensor_return - detail: 1 - name: Return - - hours_to_show: 24 - graph: line - type: sensor - entity: sensor.hvac_multisensor_supply - detail: 1 - name: Supply + - type: horizontal-stack + cards: + - type: history-graph + entities: + - entity: sensor.hvac_supply_temperature + name: Supply + - entity: sensor.hvac_return_temperature + name: Return + min_y_axis: 60 + title: Delta Temperature + - type: horizontal-stack + cards: + - type: tile + entity: sensor.hvac_supply_temperature + name: Supply + show_entity_picture: false + hide_state: false + vertical: false + features_position: bottom + - type: tile + entity: sensor.hvac_return_temperature + name: Return + hide_state: false + vertical: false + features_position: bottom + - type: horizontal-stack + cards: + - type: tile + entity: binary_sensor.hvac_fan + name: Fan + show_entity_picture: false + hide_state: true + vertical: false + features_position: bottom + - type: tile + entity: binary_sensor.hvac_aux + name: Aux + hide_state: true + vertical: false + features_position: bottom + - type: horizontal-stack + cards: + - type: tile + entity: sensor.pm_furnace_w + name: Furnace + vertical: false + features_position: bottom + - type: tile + entity: sensor.pm_heat_pump_w + name: Heat Pump + vertical: false + features_position: bottom + - type: horizontal-stack + cards: + - type: tile + entity: sensor.hvac_action + vertical: false + features_position: bottom + - type: tile + entity: input_boolean.allow_fan + vertical: false + features_position: bottom + # - type: vertical-stack # cards: # - type: custom:mushroom-title-card diff --git a/lovelace/room_cards/furnace_room.yaml b/lovelace/room_cards/furnace_room.yaml index 2c33a44..53928c2 100644 --- a/lovelace/room_cards/furnace_room.yaml +++ b/lovelace/room_cards/furnace_room.yaml @@ -94,7 +94,7 @@ elements: action: more-info - type: custom:mushroom-template-card - primary: "{{ states('sensor.hvac_multisensor_delta') }}" + primary: "{{ states('sensor.hvac_multisensor_delta') | float | round(2) }}" entity: sensor.hvac_multisensor_delta tap_action: action: more-info diff --git a/lovelace/view-ha-floorplan.yaml b/lovelace/view-ha-floorplan.yaml index 592e494..3f15f0e 100644 --- a/lovelace/view-ha-floorplan.yaml +++ b/lovelace/view-ha-floorplan.yaml @@ -367,7 +367,6 @@ cards: - sensor.downstairs_temperature - sensor.computer_area_multisensor_air_temperature - sensor.mancave_thermostat_temperature - - sensor.boys_room_thermostat_temperature - sensor.boys_room_multisensor_air_temperature - sensor.kitchen_multisensor_air_temperature - sensor.great_room_multisensor_air_temperature @@ -401,9 +400,9 @@ cards: - sensor.front_porch_temperature - sensor.deck_temperature - sensor.garage_multisensor_air_temperature - # - sensor.hvac_multisensor_supply - # - sensor.hvac_multisensor_return - # - sensor.hvac_multisensor_ambient + # - sensor.hvac_supply_temperature + # - sensor.hvac_return_temperature + # - sensor.hvac_ambient_temperature - sensor.back_yard_thermostat_temperature - sensor.outdoor_temperature # text_template: '${entity.state ? entity.state : "unknown"} F' @@ -427,7 +426,7 @@ cards: # The HVAC Delta can be positive or negative, depending on if the furnace, heat pump, or ac is running - entities: - - sensor.hvac_multisensor_delta + - sensor.hvac_delta_temperature # 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: ' @@ -500,7 +499,6 @@ cards: - sensor.computer_area_multisensor_humidity - sensor.great_room_multisensor_humidity - sensor.mancave_thermostat_humidity - - sensor.boys_room_thermostat_humidity - sensor.front_room_thermostat_humidity - sensor.kitchen_multisensor_humidity - sensor.furnace_room_thermostat_humidity diff --git a/lovelace/view-overview.yaml b/lovelace/view-overview.yaml index 1b3ed30..aa8ccea 100644 --- a/lovelace/view-overview.yaml +++ b/lovelace/view-overview.yaml @@ -155,7 +155,7 @@ badges: mdi:snowflake-off {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','slightly_uncomfortable') %} mdi:snowflake - {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','moderatly_uncomfortable') %} + {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','moderately_uncomfortable') %} mdi:snowflake-thermometer {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','highly_uncomfortable') %} mdi:snowflake-alert @@ -165,7 +165,7 @@ badges: green {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','slightly_uncomfortable') %} yellow - {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','moderatly_uncomfortable') %} + {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','moderately_uncomfortable') %} orange {% elif is_state('sensor.thermal_comfort_winter_scharlau_perception','highly_uncomfortable') %} red diff --git a/www/floorplan/fullsized_floorplan.svg b/www/floorplan/fullsized_floorplan.svg index 60013db..f674051 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.079999999" - inkscape:cx="66018.751" - inkscape:cy="37168.75" + inkscape:zoom="0.014142135" + inkscape:cx="55118.976" + inkscape:cy="30935.923" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -1854,8 +1854,8 @@ - inkscape:label="light.front_porch_overhead" /> --------- ---------- ----------