I’m a bit stuck.
I have an ESP32 with a RG-9 rain sensor running ESPHome. In HA I have a Shelly Plus 2pm “cover” device that I want to control an electric opening rooflight.
The Rainsensor is going to be battery operated and I want it to use a deep sleep interval of a few minutes, then wake up and check HA to see if the Rooflight is open or not. If it is not open, I want the rain sensor to go back to sleep. If it is open then I will start checking for rain and if/when the rain comes tell HA close the rooflight. Then the rainsensor can go back to the deep-sleep cycle.
I’ve worked out most of what I need in ESPHome but what I can’t figure out from the docs is how do I “read” the status of the Shelly cover that is in HA?
I have created a homeassistant text sensor in my ESPHome device, but what I can’t work out is how to get it actually trigger a “read”… Hopefully I’m being dense and missing something obvious…
text_sensor:
- platform: homeassistant
name: "Utility_Rooflight"
entity_id: cover.utility_rooflight
on_value:
then:
- lambda: |-
ESP_LOGD("main", "The current status is %s", x.c_str());
- output.turn_on: gpio_1