Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MQTT set issue
#1
Hi

I'm trying to set two relays at once, but only one changed.

I publish via Home Assistant MQTT:

relay32/xxxxxxxxxxxxx/set

{"relay17":{"on":1},"relay18":{"on":1}}



but only relay17 state is changed

please answer
Is it possible to set more than one relay by one MQTT publish command?

with regards,
Gene
Reply
#2
Try to set a delay of 100ms between 17 and 18.
Reply
#3
yes, support multi-output by one command. you payload should as this format:

{"relay17":{"on":0}}{"relay18":{"on":0}}
   
   
Reply
#4
Hi!

it is working.

I have made the switch as a group of relays.

  platform: mqtt
  name: "4sqdir000"
  unique_id: 4sqdir000
  state_topic: "relay32/xxxxxxx/state"
  command_topic: "relay32/xxxxxxxxx/set"
  payload_on:  '{{"relay17":{"on":1}}{"relay18":{"on":0}}{"relay19":{"on":0}}{"relay20":{"on":1}}{"relay21":{"on":0}}{"relay22":{"on":0}}{"relay24":{"on":1}}}'
  payload_off: '{{"relay17":{"on":0}}{"relay18":{"on":0}}{"relay19":{"on":0}}{"relay20":{"on":0}}{"relay21":{"on":0}}{"relay22":{"on":0}}{"relay24":{"on":0}}}'
  value_template: "{{value_json.relay17.on}}{{value_json.relay18.on}}{{value_json.relay19.on}}{{value_json.relay20.on}}{{value_json.relay21.on}}{{value_json.relay22.on}}{{value_json.relay24.on}}"
  state_on:  "1001001"
  state_off: "0000000"


All works fine!


Many Thanks for high effective support!

with regards,
Gene
Reply
#5
great, you are welcome.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)