I have an input button in HA and would like to use it as an input to ESPhome.
In ESPHome it’s defined as:
binary_sensor:
- platform: homeassistant
name: "Manual drum wash"
entity_id: input_button.manual_drum_wash
id: manual_drum_wash
on_press:
then:
- script.execute: do_drum_wash
In the logs, I see:
[09:25:46][W][homeassistant.binary_sensor:017]: Can't convert '2023-04-13T08:25:46.736193+00:00' to binary state!
Clearly, binary_sensor is not the way to go.
I’ve created a template sensor in HA:
- sensor:
- name: Manual drum wash
unique_id: manual_drum_wash
state: >
{{ states('input_button.manual_drum_wash') }}
And then used this in ESPHome:
sensor:
- platform: homeassistant
name: "Manual drum wash"
entity_id: sensor.manual_drum_wash
id: manual_drum_wash
on_value:
then:
- script.execute: do_drum_wash
This approach works, however, is this the best way to achieve this, or am I missing something simple?