Cant configure MQTT command topic

Please help. I connected the device and received its parameters through the broker.

But I can’t configure the channel to change the parameter. The pictures show what the channel looks like in MQTT Explorer and the channel settings.


spelling error zegbee2mqtt vs. zigbee2mqtt ?

Thank you!! Fix. But it doesn’t work

In general, it’s helpful to provide more information about the device. Since I can see it’s a Moes and that it’s a thermostat, I’m guessing it’s this:

In which case the parameters are:

Eco mode (binary)

ECO mode (energy saving mode). Value can be found in the published state on the eco_mode property. It’s not possible to read (/get) this value. To write (/set) a value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set with payload {"eco_mode": NEW_VALUE}. If value equals ON eco mode is ON, if OFF OFF

So, what you’ve missed is:

payload {"eco_mode": NEW_VALUE}

You’re just sending ON/OFF to the device, and it doesn’t know what to do with that…so it ignores it. There should be a message in the Z2M log saying as much.

  1. Remove the Outgoing Value Transformation, which isn’t necessary.
    • The transformation is only needed to pull eco_mode from the incoming JSONPATH string, since eco_mode doesn’t have its own state topic.
  2. Change Outgoing Value Format to {"eco_mode": %s}
    • You may need to add quotation marks around the string: {"eco_mode": "%s"}

Thank you! I tried your option

the message arrives but does not change the value in the device

it’s log file

Just try as command topic ‚zigbee2mqtt/moes1/set/eco_mode‘. As it is a switch you don‘t need an outgoing transformation.

1 Like

Thank you!! It’s working !!

channels:

  • id: eco_mode
    channelTypeUID: mqtt:switch
    label: eco_mode
    description: “”
    configuration:
    commandTopic: zigbee2mqtt/moes1/set/eco_mode
    postCommand: false
    retained: false
    formatBeforePublish: “%s”
    off: OFF
    on: ON
1 Like

Oh, interesting. I didn’t realize you could send this way if a value doesn’t have its own state topic.

Works fine for all my leds and thermostats.
Thats what the broker sees.


Oh yeah, I’m not questioning you. I didn’t realize that we could just add eco_mode after set. Instead of doing that, I was formatting the value to match the Z2M documentation.