revk / ESP32-Faikin

ESP32 based module to control Daikin aircon units
GNU General Public License v3.0
424 stars 63 forks source link

Template variable warning: 'dict object' has no attribute 'fanrpm' when rendering '{{value_json.fanrpm}}' #166

Closed DRazumovskiy closed 9 months ago

DRazumovskiy commented 9 months ago

Faikin hardware Faikin hardware, purchased on Amazon on the 6th of December 2023

Daikin hardware S21 lead

Describe the bug After startup the homeassistant log is full of messages that repeat every 5 seconds: WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'fanrpm' when rendering '{{value_json.fanrpm}}' To Reproduce Default settings on Faikin. Mosquitto MQTT broker. After each homeassistant restart the message start to appear in logs

Expected behavior No error messages

Additional context There's a workaround to cancel the message by sending an empty message to "homeassistant/sensor/XXXXXXXXXXXXfanrpm/config" topic. Needs to be repeated each time homeassistant is restarted

DRazumovskiy commented 9 months ago

Seen similar issue and workaround described in issue #150

revk commented 9 months ago

fanrpm was removed, but no way to remove from retained message in mqtt without restarting mqtt, so HA thinks it still has a fanrpm setting.

DRazumovskiy commented 9 months ago

Shall I try to restart MQTT broker then?

revk commented 9 months ago

Yes, the broker is retaining the message, so that is where the problem is.

DRazumovskiy commented 9 months ago

Thank you! Restarting broker did not help. I had to stop it, delete the database ../mosquitto.db and restart it. Found no better option to remove retained messages. Great experience otherwise, thank you a lot for doing this project!

njh commented 8 months ago

Retained MQTT messages can be deleted by sending an empty message with the retained flag set:

mosquitto_pub -h 'mqtt-server' -t 'foobar/fanrpm' -m '' -r