Im working in my home lights project and i want to achive the following.
Im using sonoff with mqtt and homeassitant. All works fine!.
With node-red im checking the actual state of my sonoff if it is ON or OFF. All works fine.
The thing is i want to get the value or string of the ON state and how much is it ON. For example, the light is ON for about 1 hour. Then make something with that.
Im using the state node of home assistant and the information describes this.
maybe i can use last_change or so but how can i get the data property?
If i put a debug the payload returns ON or OFF.
Thanks a lot in advance.