I have created a script, and I want to make some actions if the enabled property is true or false, but I don’t know why, the actions are never executed regardless the state of the ‘enabled’ property.
No, I didn’t say that
Merely because (say) the front-end shows the sensor as ‘open’ or ‘closed’ the REAL state (of a binary_sensor) will be ‘on’ or ‘off’.
You have to check and thus interpret
Extra: you just replied ‘to the thread’
As the thread owner, you get a notification (no one else does)
If you reply ‘to me’ (the reply button in the bottom right of my post) then ‘I’ get a notification too.
Or you ‘could’ tag me i.e. @Mutt but be careful doing that as it’s considered rude in most circumstances
Most sensors report a value that is representative of a state it has detected in the field.
You should not be able to write to such, you should only be able to read from it.
Things you write to are like switches or lights or say a thermostat where you can write a value such that the thermostat switches above/below this value etc.
What type of sensor is it ? (I;m assuming an esp32 or similar ?)
You also need to format your code according to point 11 of the sticky : -
Irrigation unlimited provides a service that enables manual irrigation. When this service is called, the status of the binary_sensor is changed. I meant changing the status of the sensor with this service.
Edit: jinja2 is a print language, you should be using your integrations api
Edit2: {{ ‘Hello World’ }} just prints ‘Hello World’ hence print statement
Edit3: and your two statements above resolve to true or false (both false in this case and are printed as such)
Correct; my original post was mistaken and I quickly deleted it to prevent misleading others. However, while re-editing it, the original was revealed again … long enough that others saw it. Anyway, the original is gone now (unless someone bothers to examine the post’s history).
I would guess that you need some specialist help from someone familiar with your “Irrigation Unlimited HACS Integration” - I would suggest you either find a thread concerning that (search) or you change the name of this thread to attract those specialists (the pencil you see next to the title) - I’d suggest "Help needed “Irrigation Unlimited HACS Integration” " or something similar
I used to think the system understood booleans to be true/false or True/False but it’s a bit more nuanced than that. In this case, the attribute’s value is handled as a python boolean
(due to type inference) and so it’s exclusively True/False.