Closed ExMacro closed 11 months ago
I hope that I added this sensor to configuration.yaml correctly.
mqtt:
sensor:
- name: leaf_battery_charging
# Since VIN is not specified, it will represent the state from the first vehicle in the account.
state_topic: "leaf/battery/charging"
I'm running Home Assistant 2023.9.2 and Leaf2MQTT version: 46
I hope that I added this sensor to configuration.yaml correctly.
mqtt: sensor: - name: leaf_battery_charging # Since VIN is not specified, it will represent the state from the first vehicle in the account. state_topic: "leaf/battery/charging"
I realised that I need this to be binary_sensor but it still only show "Unknown" in HA.
As far as I can tell, you should not set the device_class to "battery". When the device is a battery, it expects the value of the sensor to be an integer or a floating point number, and to represent the percentage of battery charge remaining.
Here is my setup (excerpt):
mqtt: binary_sensor:
- name: leaf_battery_charging state_topic: "leaf/
/battery/charging" payload_off: "false" payload_on: "true" device: identifiers: " " device_class: battery_charging unique_id: " _leaf_batterycharging"
Yes! The solution is to put the payload_on / off into the config. This works for me now!
Thanks!
mqtt:
binary_sensor:
- name: leaf_battery_charging
# Since VIN is not specified, it will represent the state from the first vehicle in the account.
state_topic: "leaf/battery/charging"
payload_off: "false"
payload_on: "true"
device_class: battery_charging
The solution is to add the payload into the config.
mqtt:
binary_sensor:
- name: leaf_battery_charging
# Since VIN is not specified, it will represent the state from the first vehicle in the account.
state_topic: "leaf/battery/charging"
payload_off: "false"
payload_on: "true"
device_class: battery_charging
Describe the bug This code in the configuration.yaml is not working anymore. Leaf Battery Charging Status is not working as a HA sensor. Only displays Unknown status in HA. Leaf2MQTT gets the values from the Nissan servers but the sensor configuration in configuration.yaml is not working anymore.
HA logs an error:
LEAF_TYPE Newer than 2019 (the model is MY2020)
Expected behavior The sensor in configuration.yaml was working correctly before.