Heya I created a virtual switch that is running a script.
What I still trying to figure out is on how to change the state of the switch by the state of a binary_sensor:
If do your small snipped inside the devtools my sensor turns from off to on and if I call the script again it turns off after the blind is fully closed
Go to Developer Tools > States and find the binary_sensor in the Entity column. Confirm the spelling of its entity_id. Check if it actually contains a hyphen in the entity_id.
it does, you can see the chosen entity above in my screen with the hyphen, but here again a screen directly from the entity page:
EDIT: ah… the friednly name is the problem, I see what you mean now
EDIT2: tested and confirmed, working now… god damn, I will never use hyphens again!
An entity_id contains only letters in lowercase, numbers and underscores (it’s known by the curious name ‘slug’ and there’s even a template function called slugify to convert text to a slug).
Your Template Sensor was configured to get its state from a binary_sensor that didn’t exist in your system (because the entity_id was misspelled).
For future reference, rely on Developer Tools > States to display an entity’s correct entity_id and friendly_name.
You can use hyphens in an entity’s friendly_name provided you remember that it will be converted to an underscore for the entity’s entity_id.