home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.47k stars 29.41k forks source link

Z-Wave sensor history and More Info using integer view, not decimal graph #1079

Closed partofthething closed 8 years ago

partofthething commented 8 years ago

This started after upgrading to 0.12.0. I have a Aeotech Multisensor 6 that has temperature and some other sensors.

Before the upgrade, clicking the Temperature sensor gave a More Info dialog with a nice graph showing temperature vs. time. Now it shows a colorbar (used elsewhere for integer settings). This happens for the Multisensor but not for some other Z-wave sensors I have (which still properly show the graph).

In the zwcfg.xml file, I find things that indicate it should be decimal type, not short or some other int.

            <CommandClass id="49" name="COMMAND_CLASS_SENSOR_MULTILEVEL" version="5" innif="true">
                <Instance index="1" />
                <Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="77.9" />
                <Value type="decimal" genre="user" instance="1" index="3" label="Luminance" units="lux" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="0" />
                <Value type="decimal" genre="user" instance="1" index="5" label="Relative Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="37" />
                <Value type="decimal" genre="user" instance="1" index="27" label="Ultraviolet" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="0" />
partofthething commented 8 years ago

screenshot from 2016-01-31 20-47-50

balloob commented 8 years ago

This happens when there is no unit_of_measurement defined for the entity.

On Sun, Jan 31, 2016 at 9:02 PM, Nick Touran notifications@github.com wrote:

[image: screenshot from 2016-01-31 20-47-50] https://cloud.githubusercontent.com/assets/5360219/12709178/e47a7d2a-c85d-11e5-9c28-8e3b9806812f.png

— Reply to this email directly or view it on GitHub https://github.com/balloob/home-assistant/issues/1079#issuecomment-177765056 .

PaulusSchoutsen.nl It's nice to be important but it's more important to be nice.

partofthething commented 8 years ago

Ok that's a good lead. I wonder what might have happened during the upgrade to cause it to lose its unit of measurement info. For this sensor, the state attributes are showing:

{
  "friendly_name": "Temperature",
  "unit_of_measurement": "°C",
  "node_id": 2,
  "battery_level": 100
}

So it seems that it has a unit of measurement figured out. Maybe it doesn't like the degree symbol?

BornTKill commented 8 years ago

Same for me. If you don't care loosing history, delete home-assistant.db does the trick for me.

Hope it helps.

balloob commented 8 years ago

The degree symbol should just work.

Don't delete your history just yet. It would be better to investigate and get this fixed.

You can look at the API results by going to this url (probably need to update entity filter): https://localhost:8123/api/history/period?filter_entity_id=sensor.temperature

Any states that are showing weird data?

This is the code that decides which graph to show

partofthething commented 8 years ago

I didn't delete but after 24 hours the graph switched to the proper style! I think maybe it had something wrong but the more info box only holds a day or so of data. It's working for me now with no changes on my part. If it happens again I'll look at the API results and post the offending data. I think it's safe to close for now.