Need history-graph to be an actual graph, not a bar

it most likely is picked up initially, but there could be a number of factors that made it a bar graph / line graph:

  • If the device is already in history as bar graph, it will show up as bar graph. You have to delete your history at this point or purge it and compress.
  • If the state cannot be converted to a number, it will show up as a bar graph. (Like if the sensor returns units with the value in the mqtt topic instead of just the value). I.E. you can’t confvert ‘67 ºC’ to a number because ºC is not a number.
  • After you made the change, you didn’t clear the cache in your browser which kept it a bar graph.

Basically what I’m saying is: If they are configured as ºC in the sensor section, then they should show up as a line graph.

It’s irksome, because they were always configured as “degC” in the configuration. I was clutching at straws when I added unit_of_measurement to the card.

How do I delete history / purge / compress?

I do understand string splitting (software engineer!). In fact, I’m about to tackle the problem of why my WiFi signal strength (as extracted from the Tasmota JSON string returned by /STATE) is being returned to Home Assistant as a string rather than an int. I can’t find a Lovelace card which displays a string.

purge is a service. Delete is just remove the .db file from configuration when HA is off. Compress might not be possible at the moment.

Also, one thing I did notice is that ‘unknown’ was coming through as a state. That could be the root cause of your issues. You may need to add a value_template to your MQTT topic to convert all numbers to a float. In the event that ‘words’ come through, it will be converted to the default float. The default float is zero.

1 Like

Hi i got this issue. i got a wind value lets say N 5 for nort 5 m/s.

Ist it possible to tell HA to ignore the letters in this value N,E;S;W and only read the numbers so i get a graph?

This will split the letter N from the number 5 using space as the separator, then the [-1] chooses the last item in the list. The list at that point should be ['N', '5'], so using [-1] will get the last item in the list. - dictates going backwards through the list. When combined with 1, it’s saying get the first item going backwards.

{{ value_json[“GetSingleStationResult”][“Samples”][1][“Value”].split(' ')[-1] }}

You may have to delete your database to make it become a graph now.

1 Like

Hi
I get this error

Error loading C:\Users\Mediaserver-pc\AppData\Roaming.homeassistant\configuration.yaml: while parsing a block mapping in “C:\Users\Mediaserver-pc\AppData\Roaming.homeassistant\sensor/weather.yaml”, line 5, column 4 expected <block end>, but found ‘<scalar>’ in “C:\Users\Mediaserver-pc\AppData\Roaming.homeassistant\sensor/weather.yaml”, line 8, column 92

The space in .split(’ ') is column 92

Can it bee because it use also decimal? ex. N 5.1

Incorrect quote types, this should work

"{{ value_json['GetSingleStationResult']['Samples'][1]['Value'].split(' ')[-1] }}"

worked like a charm, thanks

I am looking for exactly the opposite solution I have a line graph which shows nothing because it has words instead of number so a bar graph would be better suited for the more-info card

Remove the unit of measurement.

this is what I could find in the core.entity_registry as it is a autoloaded I tried to put null instead of the double quotes and it broke so would I just delete the unit_of Measurement line all together?

   "aliases": [],
    "area_id": null,
    "capabilities": null,
    "config_entry_id": "9fd0f14e2138d01eb6e53f510de1f0f8",
    "device_class": null,
    "device_id": "3dbcaeb411107de1c074e4338a9d309a",
    "disabled_by": null,
    "entity_category": null,
    "entity_id": "sensor.victron_solarcharger_mppoperationmode_226",
    "hidden_by": null,
    "icon": null,
    "id": "2ef9da97692edf6f2ef7aa19447b90f0",
    "has_entity_name": false,
    "name": null,
    "options": {},
    "original_device_class": null,
    "original_icon": null,
    "original_name": "solarcharger mppoperationmode",
    "platform": "victron",
    "supported_features": 0,
    "translation_key": null,
    "unique_id": "226_solarcharger_mppoperationmode",
    "unit_of_measurement": ""

Please don’t mess around with the .storage registry. Edit the sensor config, or if it was discovered use customize.

well the customize does is allow me to change the name and area so where do I set the unit of measurement in it?

well I think I will jack with this tomorrow after work I will try deleting the unit of measurement from the core.entity_registry file since that seems to be the only place it is even showed the customize option does not offer anything to deal with unit of measurement

Don’t use the GUI.

https://www.home-assistant.io/docs/configuration/customizing-devices/#manual-customization

Not going to since customize does not do what I need I guess, not sure why you suggested using something that won’t do what I need in the first place but no worries at least I can get to it directly and edit it

Why do you not think it solves your issue?

You just told me not to use it after I posted the screenshot of it only other way I can see is directly edit the file

Customize will do what you want… have you read his links or are you assuming customizing is done through the UI? It’s done via yaml, highlighted in the links he posted.

Well it doesn’t give me a place to edit except in the storage folder so that’s where I will deal with it, not really to worried about it, just would have been nice to get the bar graph, but not worth getting all the flack and being insulted through it all which is what is going to come in short order so I will take my leave of this thread before it gets to that point