I’m totally new to HA and am only just scratching the surface of writing code, learning as I go and way below the level of most posts. Anyway, I’m trying to get a history graph using an entity of a fan heater which by default shows three sets of data on the graph - set temperature, actual temperature and heating. What I want is just to show “heating” i.e. the on/off state of this entity, like I can for a switch, over time. I can’t find any way using the code editor to show only one set of data, or any list of what code can be used with the history graph
What is shown for the climate entity is not configurable. If you want to see only on/off status, than you would need to make a binary_sensor template which tracks that, and then add that binary_sensor to the history-graph instead.
Otherwise, all options of the history graph card are listed in the documentation: History graph card - Home Assistant
Thanks - I’ll have a search on that and see if I can work out how to set up a binary_sensor template. Hopefully there’s some easy-to-understand documentation for it
My search for help on setting up a binary_sensor template wasn’t productive. Is there a step-by-step tutorial and guide to this topic that could help me, or do I need to learn more basic stuff first?
More generally, I’ve entered HA with a Green and it has automatically connected most of my devices that I’ve previously had set up under different brand apps (mostly Tuya) and I’ve been able to play round with dashboard configuration with some success using a combination of intuition and copy-paste. But I’m finding progress beyond these things like hitting a wall, given my lack of coding education and experience. Where to start, without spending inordinate amounts of time on this?
Settings > Helpers > Create Helper > Template > Binary Sensor
In the state template box, enter:
{{ is_state_attr('climate.gbh500', 'hvac_action', 'heating') }}
When you complete the form a new binary sensor will be created.
Thanks. That appears to work - the binary sensor is created and I can use it as an entity in the history graph (the second panel of the three in the screenshot). I assume that it will only show data from the time of its creation forward. The coding is way over my head - I recognise the entity and the attribute, but what all the other stuff is doing is beyond my experience. Searching for youtube videos on templating, I get the impression that they are not for beginners like me.
This is what the history plot etc. for the GBH500 looks like
Next thing I’m battling with is plotting my wunderground pws data in HA. I’ve managed to add Weather Underground as an integration with my weather station ID and the api key, but I can’t figure out how to access the sensor data. I’ll post more info on this later
Coming back to this, the binary sensor was created, but it stays in the state “off” all the time. It doesn’t seem to register the change in the GBH500 attribute. I made some modifications to your code for the template box based on what the GBH500 attributes were listed as in the Developer tools>state. This is my version:
{{ is_state_attr('climate.gbh500', 'hvac_modes', 'heat') }}
This is the attribute description for the heater
With the changes, the binary sensor still stays at “off”. How does the template communicate with the binary sensor? I assume the template gives “true” and “false” results which the binary sensor converts to “on” and “off”. Where can you see the code for the binary sensor? There’s no “edit in YAML” option in the helpers tab, that I can see. Any tips, explanations etc. appreciated - it’ll all help me get my head around HA a bit more