I am still a newbie when it comes to HA so please be gentle with me!
I am using a custom intergration (Wiser Heating Component) and and trying to display a state attribute.
If I look in the developers states under the entity “climate.wiser_xxxx” there are 17 or so state attributes available and the one I’m interested in is “control_output_state” which is either “on” or “off”, basically it tells you when the room is requesting heat.
Is there anyway I can view this attribute directly in lovelace and then convert the value from on/off to show the total amount of time it has been on throughout each day? Ideally I would like to then use this information to log and display in influxdb and grafana.
Create a Template Sensor to report the value of control_output_state. Then use the History Statistics integration to create a sensor that monitors the Template Sensor and reports how much time it is on.
Let me know if you need more help creating these entities.
To display the attribute in Lovelace just use the entities card. It supports displaying attributes.
If you want to display how long it has been on you will have to configure a history stats sensor:
However this only supports entities not attributes, so you will have to configure a template binary sensor to break out the attribute into it’s own sensor.
However when I try and and the entity to Lovelace it displays the “On” time as a percentage of an hour, clicking on it to view the graph displays both percentage and value in minutes. How can I just display hours and minutes and not as a percentage?
Both the template and sensor created ok and passed the config test but any value always remains at the state off.
The reason I thought it was working was I changed the values to reflect off as my heating isn’t on at the moment just to see if I could get a reading, then changed the template and sensor to ON state turned the heating on and the state didn’t update. If I query the state from the developers STATE option and view the state attributes it shows correctly as being on show why isn’t my binary sensor updating?
EDIT: Just noticed in the screenshot that the attribute you’re looking at appears to be 'On' not 'on'. That’s likely to be your problem, although I’d encourage adding the entity_id as good practice.
The “backticks” suggestion was for formatting code displayed in this forum. If you look at what you posted, it lacks proper formatting. To display formatted code in a post:
Type three consecutive back-quotes ``` on a separate line before your code.
Type three more consecutive back-quotes on a separate line after your code.
The forum’s Editor will understand that you want everything between the two sets of triple back-quotes to be presented as formatted code.