[solved] "platform": "mqtt_json" is deprecated, replace with "schema":"json" Since upgrade to .8.4.1

Hi All,
Since updating to .8.4.1, I’m now seeing this message in my HA log.

I use esphomeyaml to configure my MQTT devices that are triggering this error.

2018-12-14 17:32:40 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/light/laundrylight01/laundry_light_green_led/config: b'{"brightness":true,"flash":true,"name":"Laundry Light Green LED","platform":"mqtt_json","state_topic":"laundrylight01/light/laundry_light_green_led/state","command_topic":"laundrylight01/light/laundry_light_green_led/command","availability_topic":"laundrylight01/status"}'

2018-12-14 17:32:40 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on laundrylight01/light/laundry_light_green_led/state: b'{"state":"ON","brightness":255}'

2018-12-14 17:32:40 WARNING (MainThread) [homeassistant.components.mqtt.discovery] "platform": "mqtt_json" is deprecated, replace with "schema":"json"

I’m not sure if this a question for the esphomeyaml people (to change this ) or I need to do something in HA to fix it.

Can anybody clarify what is happening here?

Thanks

This was a breaking change for 0.84 . See the release notes.

Thnx, Must have missed it :frowning:

So as I understand it, I will have to add the following in my configuration.yaml for my lights instead of using Discover?

light:
  - platform: mqtt
    schema: json

pardon my lack of knowledge of MQTT :slight_smile:

2 Likes

You probably have to update ypur device to send the correct discovery message, if you want to continue using discovery.

1 Like

OK, Thnx :slight_smile:

How do we update devices to send correct message? Sorry, I’m having the same issue.

I have no idea what your devices are, so I cannot tell how you to upgrade them. You need to follow the instructions you used when you installed the code initially.

The only MQTT devices I have are Philips Hue bulbs through zigbee2mqtt and they seem to be still working minus the errors

This message means that the platform will not be supported at some release in the future, so you need to update your device reasonably quickly to the new schema format.

So in my case do I just have to re-pair my bulbs? How do I fix this?

You have to replace whatever is sending the discovery message in your system with a new version that sends the correct message. But since I have no idea how your system works, I can’t help you any further.

@OttoWinter is this also needed on EspHomeYaml?

3 Likes

You will need to see if there is an update to zigbee2mqttso that it sends the correct format.

1 Like

esphomelib will be updated in the future, until then everything should keep working

Hi,

what can I do on the esphomelib side to avoid these error messages in the HA log?

I also see weird behaviour with, after triggering the relay, the status is “Unavailable” for some time, the switch in HA doesn’t move and then suddenly “jumps” to its new position with some delay. Sometimes the relay also seems to be triggered twice, at least you can hear it clicking twice. Maybe related?

this thread title says [solved] yet none of the posts are marked as the solution… I have this error and don’t use (any longer) MQTT so would like to know what I need to do to fix it if someone can assist

hey @sparkydave. download a tool called mqtt explorer. then connect to your broker and delete the reatined messages.

if you dont have MQTT broker, then there is a mqtt entry somewhere in your configs (suspect its a light)

2 Likes

Thanks, I’ll give it a try when I get home. The only time I even use MQTT was with an ESP node using ESPhome before the API came out. I’ve since switched to the API but maybe there is still a retained message as you suggest. Cheers