I had thought there would be a simple way of changing open to close but am not finding anything.
I have a ZHA magnet door sensor on a Gate, by virtue of the physical setup with the magnet closed I actually want it to show OPEN. Is there a way to invert this?
Spook has an 'invert state of an entity ’ function.
It can also be done in a Template Binary sensor Helper with a pretty basic state template:
{{ is_state('binary_sensor.example', 'on') }}
Or, if you’re a bit comfortable with YAML, you can use the built-in Template Blueprint called “Invert a binary sensor”, which is a little more robust than what you get from the Helper.
Thanks for info. I used Spook and it did the job. Both appreciated,
I did actually look at the blueprint, I Imported it, but it doesnt appear in Blueprints. Is this a different type of blueprint / you mentioned it was built in?
Template blueprints are different than script and automation blueprints, and they do not have a GUI component yet. You have to configure them in YAML.
The “Invert a Binary Sensor” blueprint was written by the HA team and I thought it should already be installed in the folder config > blueprints > template > homeassistant
… but I may be mistaken about that.