michaelwoods / onstar2mqtt

OnStarJS wrapper for MQTT
MIT License
109 stars 40 forks source link

vehicle_range should not publish invalid values #98

Open Gibby opened 2 years ago

Gibby commented 2 years ago

All working good when vehicle is running. However, I see this when the vehicle is off.

info: Publishing message {"payload":{"availability_topic":"homeassistant/xxx/available","device":{"identifiers":["xxx"],"manufacturer":"GMC","model":"2021","name":"2021 GMC Yukon Denali XL"},"name":"Gas Range","payload_available":"true","payload_not_available":"false","state_topic":"homeassistant/sensor/xxx/vehicle_range/state","unit_of_measurement":"km","value_template":"{{ value_json.gas_range }}"},"topic":"homeassistant/sensor/xxx/gas_range/config"}  

info: Publishing message {"payload":{"availability_topic":"homeassistant/xxx/available","device":{"identifiers":["xxx"],"manufacturer":"GMC","model":"2021","name":"2021 GMC Yukon Denali XL"},"name":"Gas Range Mi","payload_available":"true","payload_not_available":"false","state_topic":"homeassistant/sensor/xxx/vehicle_range/state","unit_of_measurement":"mi","value_template":"{{ value_json.gas_range_mi }}"},"topic":"homeassistant/sensor/xxx/gas_range_mi/config"} 

info: Publishing message {"state":{"gas_range":"XXX","gas_range_mi":null},"topic":"homeassistant/sensor/xxx/vehicle_range/state"}                                                               
michaelwoods commented 2 years ago

@Gibby did you censor the gas_range value or is it literally "XXX"?

Gibby commented 2 years ago

@michaelwoods it is literally XXX when the vehicle is off.

BigThunderSR commented 2 years ago

I am also seeing this on one of my two cars. It fixes itself after you start driving. Not seeing the issue at all on the other car though.