alandtse / tesla

Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Apache License 2.0
591 stars 100 forks source link

MQTT and state class warnings with v3.12.1 #586

Open drjjr2 opened 1 year ago

drjjr2 commented 1 year ago

I am seeing these warnings with the latest v 3.12.1 version with MQTT enabled: I don't have a scheduled charge start time so that is just an error check. Not sure why my odometers and energy added wouldn't be "total_increasing"

2023-04-28 09:34:24.771 WARNING (MainThread) [homeassistant.components.mqtt.sensor] Invalid state message '' from 'teslamate/cars/1/scheduled_charging_start_time'
2023-04-28 09:34:24.805 WARNING (MainThread) [homeassistant.components.mqtt.sensor] Invalid state message '' from 'teslamate/cars/2/scheduled_charging_start_time'

2023-04-28 09:35:10.486 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.don_s_model_3p_energy_added from integration tesla_custom has state class total_increasing, but its state is not strictly increasing. Triggered by state 3.52 (3.66) with last_updated set to 2023-04-28T14:34:25.309338+00:00. Please report it to the custom integration author.
2023-04-28 09:35:10.503 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.odometer from integration tesla_custom has state class total_increasing, but its state is not strictly increasing. Triggered by state 520.77 (520.78) with last_updated set to 2023-04-28T14:33:34.400555+00:00. Please report it to the custom integration author.
Megabytemb commented 1 year ago

hmm.

This might be a rounding error on the conversation between miles and KM (for the odometer) Not sure about the Energy Added sensor.

Does it make sense for some entities, if the newvalue is not greater then the current value, ignore?

Thoughts?

drjjr2 commented 1 year ago

It does look like a rounding error. Might ignore it if it's some +-1 or whatever the rounding is for the conversion. And yeah, not sure about the energy added. Seems like we'll have to account for quirks in the reporting from Tesla.

The invalid state messages above that arebecause I don't have a scheduled start time for charge?

Megabytemb commented 1 year ago

So, initially, i added all sensors from TeslaMate purely for feature completeness. However, if it's causing errors for total_increasing sensors, should i just remove energy_added and odometer?

are they adding much value being updated in realtime?

The00Dustin commented 1 year ago

I am not using MQTT, but I saw this msessage in the logs once and thought it might be more helpful here than as a new issue:

Entity sensor.vehicle_energy_added from integration tesla_custom has state class total_increasing, but its state is not strictly increasing. Triggered by state 22.82 (22.83) with last_updated set to 2023-08-05T03:48:19.252071+00:00. Please report it to the custom integration author.

Warning details for the message above follow:

Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:405 
Integration: Sensor (documentation, issues) 
alandtse commented 1 year ago

I am not using MQTT, but I saw this msessage in the logs once and thought it might be more helpful here than as a new issue:

Entity sensor.vehicle_energy_added from integration tesla_custom has state class total_increasing, but its state is not strictly increasing. Triggered by state 22.82 (22.83) with last_updated set to 2023-08-05T03:48:19.252071+00:00. Please report it to the custom integration author.

Warning details for the message above follow:

Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:405 
Integration: Sensor (documentation, issues) 

Please use a new issue instead of adding to an unrelated. That said, I believe this already has an open issue.

The00Dustin commented 1 year ago

Sorry, I thought it might be related after my search. To be clear, after looking closer, the entry I posted is identical to the third line in the OP log. I didn't find any other matching issues. I will monitor and create a new issue if it recurs.