I have created a sensor template for my WeMo Insight Switch to monitor my washing machine. The template looks as follows:
- platform: template
sensors:
laundry_state:
friendly_name: 'Laundry'
value_template: >-
{%- if is_state("switch.washing_machine", "off") %}
Off
{% elif states.switch.washing_machine and states.switch.washing_machine.attributes.current_power_mwh < 8000 %}
Ready
{% elif is_state("switch.washing_machine", "on") %}
On
{% else %}
...
{%- endif %}
What I don’t understand is that the history component shows the history data in a graph (without any data) with a vertical scale from 0.00 to 1.00, instead of showing the text states [“On”, “Off”, “Ready”, “…”] in a color horizontal bar (I hope you know what I mean).
Is there a way to force the history component to do this?
I’m trying to create a sensor that pulls from the attributes of the mobile_app battery sensor to see if my phone is charging or not. It pulls the data and shows charging or not charging, but it shows a graph for some reason instead of the bar that shows the state which is what I am trying to get.
Yes, it appears it is. Well, when it was added to your database, it most likely had the first value as a number. What’s your db purge interval? More than likely, when that interval is met, the system will change it to a non-unitized sensor and it will become a bar graph.