This is a question similar to one I asked last week, but that thread got way off topic. So, I am trying again.
I am trying to enable/disable OTA in an ESP node without using MQTT. I have it working. Sort of.
What works is a switch in the node yaml:
switch:
- platform: gpio
name: ${device_name} otamode
pin:
number: D4
mode: output
id: ${device_name}_d4
And in the script I test the switch state:
- if:
condition:
switch.is_on: ${device_name}_d4
then:
This works exactly as I want, except for one small issue… I can only control the switch state from the front-end when the ESP is online.
So, why not use a helper entity? It would be there whether the ESP is online or not.
I created a boolean helper that I can control in the front-end. But, how do I test it in a script?
I can’t test it with a .is_on: condition, (Or can I?)
I tried reading the state:
-if:
condition:
state:
entity_id: input_boolean.ota_mode
state: "on"
then:
But my expertise with yaml is about as hopeless as is possible.
Any tips would be appreciated.