I have some mqtt sensors, but in HA 0.85.0, there is a new way to configure the old json_attributes list.
Is there any example to migrate to the new way??
I receive this warning in log:
configuration variable "json_attributes" is deprecated, replace with "json_attributes_topic"
But, if I change only this name, I receive this:
Invalid config for [sensor.mqtt]: value should be a string for dictionary value @ data['json_attributes_topic']. Got ['name', 'mac', 'discovered_devices']. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.mqtt/
I had the same thing following the .85 upgrade. The above change worked for me, but now I get all the states in the json string, rather than simply the one specified in the value_template. Not an issue, just shows them all (~16).
To get the attributes I simple copied the state_topic to the json_attributes_topic.
But as mentioned before this will show all of the attributes, which is not as smart as before (picking the right ones).
I wonder if an issue should be created to keep also the old configuration style because it is smarter for setups where you cannot change MQTT message payloads.
Iām receviing the configuration variable "json_attributes" is deprecated, replace with "json_attributes_topic" error in my logs but for the life of me I canāt find any references to json_attributes anywhere in my config files.
Is there something hidden I should be looking at?
I used zigbee2mqtt amongst other things such as MQTT sensor templates. Below is a snippet from one of my MQTT sensors, would that cause any issues?
I have the same issue as aptā¦ I use zigbee2mqtt. I originally had it all set up pairing devices through that component and then managed to break it all. All the data files were still in tact but I was trying to rebuild the MQTT integration (under config). I ended up deleting it and Hassio āauto discoveredā my old config and it started working again. Below is the integration (apt: it is under configuration -> integrations).
Interestingly, I do have the same number of json_attributes errors as I have sensors under that integration, but I canāt find the text ājson_attributesā anywhere in my files either.
Do you know where the files may have been stored? I checked the /share/zigbee2mqtt files.
Have you updated the zigbee2mqtt component under the Hass.io menu? It should be version 1.1.1, which made the error go away for me. I didnāt have to change any of my code.
Having manually configured all my YAML to use to new json_attributes_topic I am still getting warnings in the HA log about /mqtt/sensor.py and using json_attributes
I am running 1.1.1 and 0.87.0
Someone suggested maybe auto discovered devices? I have a bunch I donāt use that I manually added and HA added as well (Iād love to get rid of them)
@stratplayer I was having these error messages as well, turned out I had retained messages from old devices in my mqtt database. Check this out: https://github.com/Koenkk/zigbee2mqtt/issues/713
It mentions hass.io but thatās besides the issue. I have a separate mqtt container so i just removed my mosquitto.db. If youāre using the HA integrated mqtt you should see if you can clear the retained messages as mentioned in the url i mentioned.
Good luck.
edit:
I think I had json_attributes in āhomeassistant/light/+/+/configā and āhomeassistant/sensor/+/+/configā. be sure to check out both.