JSON/RESTful sensor entity that resets its values daily: Timezone problem

Hi,

I have an entity that I pull from an inverter which resets some values daily. I included it using the RESTful add-on via JSON.

Now when I view the graph for this entity in HA, it is shifted by an hour (currently), as my TZ is Berlin and the JSON received value is UTC.

I don’t have a computer close, but I think the mobile view does it. :slight_smile: It is indeed an hour.

I could write a minimal wrapper, but I sure am just missing some cool filter features here. I just started with HA.

André

Check how the date/time is stored…what you pull might have the wrong TZ

It doesn’t come with any timezone. It just resets some stats daily. And daily is UTC for this inverter.

The device is already configured for Berlin. :confused:

how are the date/time shown in the sensor?

There is no date or time sent at any point. The sending inverter resets the collected data daily. But UTC.

In the graph you see above HA the time is shifted slightly. It cannot know that this is a sender that resets its values daily. Or perhaps I can add that as Attribute somehow? Creating a datetime field with UTC date. That would be great and probably fix the graph.

HA does nothing wrong, it is just the inverter resetting at the wrong time. :slight_smile:

show the sensor details…you are not making it easy without actual data

The graph is not shifted. Your inverter is shifted. It resets the values at 1:00 CET.

OK, so in conclusion, the data retrieved is correct and the graph is correct. I’m not sure what you are asking us to do then. You should take a look at your inverter if you’re concerned with the aesthetics of the graph. HA can deal with this as long as you set the sensor’s state_class attribute to total_increasing.

Also, your graph’s y-axis indicates that this is measured in “kW”, but the data itself looks more like energy consumption, so should have “kWh” as unit of measurement?

Exactly this. Just that it resets at UTC and not Europe/Berlin time.

The values are reset by the inverter at 0:00 UTC. So I need to tell HA somehow that the graph should be shifted or something like that.

When it is 0:00 in London or 0:00 UTC it is 1:00 in Berlin. So 0:00 UTC is the same as 1:00 in Berlin. And HA is showing you that the reset was at 1:00 local time. You have to correct the time zone of your inverter.

1 Like