Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for recent ESPHome releases #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions esphome/esphome_smarttherm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,28 @@ output:
id: pwm_output

switch:
- platform: gpio
pin: D4
id: onboard_led
inverted: True
internal: True

- platform: template
name: ${unit_name}_heating
id: heating
entity_category: config
restore_state: True
restore_mode: RESTORE_DEFAULT_OFF
icon: "mdi:water-boiler"
optimistic: True
turn_on_action:
- switch.turn_on: onboard_led
- light.turn_on: onboard_led
- script.execute: set_pwm_level_from_slider
turn_off_action:
- switch.turn_off: onboard_led
- light.turn_off: onboard_led
- script.execute: set_pwm_low_level

light:
- platform: status_led
id: onboard_led
internal: True
pin:
number: D4
inverted: true

script:
- id: set_pwm_level_from_slider
then:
Expand Down Expand Up @@ -106,6 +109,7 @@ number:
mode: slider
optimistic: True
entity_category: config
icon: "mdi:gas-burner"
on_value:
then:
- sensor.template.publish:
Expand Down Expand Up @@ -175,6 +179,7 @@ binary_sensor:
pullup: True
name: ${unit_name}_active
id: power_active
device_class: power
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this device_class is right here. Its meant for current measuring in watts: https://developers.home-assistant.io/docs/core/entity/sensor/#:~:text=SensorDeviceClass.POWER
I suggest is to remove this line

Copy link
Author

@nagyrobi nagyrobi Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, see: https://www.home-assistant.io/integrations/binary_sensor/#device-class

Binary sensors have device class, which sets the icon and the name (language specific) for the state corresponding to true/false (like open/closed, locked/unlocked powered on/powered off).

In this case, device class power: on means power detected, off means no power, with appropriate state translated to each language, plus a plug icon with state coloring.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thank you for contributing.

filters: # debounce
- delayed_on: 5s
- delayed_off: 5s