Line chart in device type handler

I have smartthings and Xiaomi hygrometer.
I want to show current temperature, current humidity, today’s maximum temperature, minimum temperature, maximum humidity, minimum humidity, and daily temperature and humidity graphs.

Is there a way to satisfy the above conditions without using external elements such as Google Spreadsheets?

Please let us know if there is anything that has already been developed free of charge.
If there is not, please advise development direction.

It’s possible for 48 hours. The solar panel handler that @ahndee made does it.

3 Likes

I am surprised. I will take prjct92eh2’s word on it that that particular device can show graphs.

However, when I was trying something similar just the other day, I came to the conclusion–which may have been wrong, of course–that it was only possible using a complex setup that would require a server on the local LAN. There was a post here somewhere that did something like this.

Essentially, I think, tiles cannot be made aware of anything other than the one current value to which they apply. They cannot access past events. In fact, device.events() does not even work within a device handler.

Very little can be changed dynamically, and only according to that one value. What I think you can do is set the image url to a static url that is updated dynamically by the server. In other words, I don’t think you can make the url change based on a value, like “http://server/img?show=${‘currentValue’}”. Rather, you can point to “http://server/img”. Then you output the data you want to the server in another way, and the server generates the image according to the data. When the tile accesses the url, it gets a generated image based on the last received data by the server.

The bottom line is, if this is indeed the only way to make a chart happen, then it is a very cumbersome and complicated way. You would have to ask yourself whether it is really worth the trouble, or whether you don’t really need to see a fancy graph after all.

Here’s one alternative thought that you could look into. You could have several custom attributes that store past values. So humidity4HoursAgo, humidity5HoursAgo, humidity6HoursAgo, and so on. Then you might be able to use a multi-value tile to make something half decent.

1 Like