[SOLVED] New? "Invalid config for [mqtt]: [off_delay] is an invalid option for [mqtt]"

Hi, suddenly I can’t validate my config because of “off_delay” in a mqtt sensor config. It’s been there for three years. Started happening today. I don’t see any mention of this in the documentiation. Any tips?

this is the mqtt switch:

    - state_topic: "tele/rfbridge/RESULT"
      name: "HallLeft"
      value_template: "{{value_json.RfReceived.Data}}"
      payload_on: "C50C01"
      off_delay: 2

Thanks!

Edit: I see it’s some sort of bigger deprecation? After removing “off_delay”, I’m getting

Invalid config for [mqtt]: not a valid value for dictionary value @ data['mqtt']['light'][0]['schema']. Got 'default'
required key not provided @ data['mqtt']['switch'][2]['command_topic']. Got None. (See /config/configuration.yaml, line 49).

I literally haven’t touched the configuration.yaml in weeks if not months.

Here’s the config.yaml

Switch, sensor (you’ve said both) or binary sensor (which does support off_delay)? Where in your config is this, and what is the exact error message?

Switch, sorry. These are shitty RF buttons integrated via Sonoff RF Bridge and MQTT. They work much more reliably with off_delay defined (probably as some sort of debouncing but that’s where my knowledge ends).

mqtt:
  switch:
    - state_topic: "tele/rfbridge/RESULT"
      name: "HallRight"
      value_template: "{{value_json.RfReceived.Data}}"
      payload_on: "C50C04"
      off_delay: 2

I have added the yaml to the OP. I repeat, the config has been working for almost four year now, until today.

Your config isn’t a switch though — it has no output. It’s a binary sensor config under the switch heading.

That’s 2 errors copied & pasted together.

That’s not possible as switch does not support off_delay and never has.


I suggest you post the entire file. Your link does not work to your file in your original post.

Here’s the fixed link: https://transfer.sh/hm7EUvQJFl/configuration.yaml

(I don’t know what’s happening today, this is literally what Synology Drive produced!) Screenshot 2023-06-18 at 22.17.43

I understand the switch config is weird but I really set this up almost four years ago, haven’t touched it since and it has been working and there was never an issue validating this. It’s a RF switch, so it’s really a sensor sensing the RF code and acting as a switch. I really can’t remember why it’s set up as this but it has been working.

Be that as it may, the yaml for some reason doesn’t validate even without it. This is now also not validating:

mqtt:
  light:
    - state_topic: "zigbee2mqtt/Tradfri bulb"
      availability_topic: "zigbee2mqtt/bridge/state"
      brightness: true
      schema: "json"
      command_topic: "zigbee2mqtt/Tradfri bulb/set"

Again, I bought this bulb in 2019 and haven’t touched its config since (I know it’s now fully configurable in Zigbee2MQTT), and it has been happily validating until today.

That’s not possible as the mqtt configuration was changed about 7 months ago, so you at least had to fix it then if you update regularly.

now it’s telling me

Invalid config for [mqtt]: [payload_on] is an invalid option for [mqtt]. Check: mqtt->mqtt->sensor->2->payload_on. (See /config/configuration.yaml, line 49).

That’s just really wrong, isn’t it? Since when is payload_on not a valid MQTT option?

I do update on day 1, and I haven’t changed this. I don’t use that RF switch very often, I definitely have not adjusted this at all, and it has been validating fine. I can maybe even dig up old backups.

Problem solved, something (??) has removed the “binary sensor” heading. Unless I was changing my yaml in sleep, I don’t know how this happened, I don’t manually edit the yaml much these days.

The window and “hall left/right” entries were supposed to be under a binary sensor heading that “somehow” got deleted. It now validates as expected.

Thank you guys and sorry for wasting your time.

1 Like

FYI MQTT breaking change occured 2022.6. So you had to update it between then and 2022.9 when the changes became breaking.

The format changed from

<domain>:
- platform: mqtt
  ...

to

mqtt:
  <domain>:
    ...
1 Like