Posts: 20
Threads: 2
Joined: Apr 2022
Reputation:
0
08-21-2022, 09:26 PM
I was using this both KC868-H32B Relay modules with touch switches and MQTT with Home assistant. This was working fine. Suddenly one relay module reset to its ip address to 192.168.1.200 by itself and now nothing is working. Even touch switches are not working. I change the ip back to the existing one. but still doesn't work. Do you have any idea to fix this?
Posts: 6,340
Threads: 811
Joined: Oct 2020
Reputation:
156
what load you have connected with relay?
Posts: 20
Threads: 2
Joined: Apr 2022
Reputation:
0
Good Morning Wei Xu,
I got 2 units of KC868-H32B modules and it's working fine with Home Assistant. I want to create an entity on Home Assistant to send a command to turn all 32 relays at once. Since you are an expert on this, Can you please tell me whether the following command is right, and if it's wrong Can you fix it for me please?
Thank you.
switch:
- name: 'output-1-32'
unique_id: output-1-32
send: {"all_outputs":{"value":true}}
send: {"all_outputs":{"value":false}}
state_topic: 'relay32/99f9caa4068e7805b09f9a6a/state'
command_topic: 'relay32/99f9caa4068e7805b09f9a6a/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
Posts: 6,340
Threads: 811
Joined: Oct 2020
Reputation:
156
if you use home assistant, just ENABLE the ALL ON/OFF switch on dashboard. click "edit" card, then you will see the TOGGLE button option, just enable it.
this button for conrol ALL ON/OFF.
Posts: 20
Threads: 2
Joined: Apr 2022
Reputation:
0
08-19-2023, 01:14 PM
(This post was last modified: 08-20-2023, 03:13 PM by saun2000.)
I am using the Love Place dashboard as I can organize by areas and zones more better than the normal dashboard. That is the reason I am trying to get one ENTITY created to operate all the lights. Please refer to the attached pictures.
Posts: 6,340
Threads: 811
Joined: Oct 2020
Reputation:
156
if you want all 32 channel relay ON /OFF, just replace:
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
with
payload_on:{"relay1":{"on":1},"relay2":{"on":1},"relay3":{"on":1},"relay4":{"on":1},"relay5":{"on":1},"relay6":{"on":1},"relay7":{"on":1},"relay8":{"on":1},"relay9":{"on":1},"relay10":{"on":1},"relay11":{"on":1},"relay12":{"on":1},"relay13":{"on":1},"relay14":{"on":1},"relay15":{"on":1},"relay16":{"on":1},"relay17":{"on":1},"relay18":{"on":1},"relay19":{"on":1},"relay20":{"on":1},"relay21":{"on":1},"relay22":{"on":1},"relay23":{"on":1},"relay24":{"on":1},"relay25":{"on":1},"relay26":{"on":1},"relay27":{"on":1},"relay28":{"on":1},"relay29":{"on":1},"relay30":{"on":1},"relay31":{"on":1},"relay32":{"on":1}}
payload_off: {"relay1":{"on":0},"relay2":{"on":0},"relay3":{"on":0},"relay4":{"on":0},"relay5":{"on":0},"relay6":{"on":0},"relay7":{"on":0},"relay8":{"on":0},"relay9":{"on":0},"relay10":{"on":0},"relay11":{"on":0},"relay12":{"on":0},"relay13":{"on":0},"relay14":{"on":0},"relay15":{"on":0},"relay16":{"on":0},"relay17":{"on":0},"relay18":{"on":0},"relay19":{"on":0},"relay20":{"on":0},"relay21":{"on":0},"relay22":{"on":0},"relay23":{"on":0},"relay24":{"on":0},"relay25":{"on":0},"relay26":{"on":0},"relay27":{"on":0},"relay28":{"on":0},"relay29":{"on":0},"relay30":{"on":0},"relay31":{"on":0},"relay32":{"on":0}}
Posts: 20
Threads: 2
Joined: Apr 2022
Reputation:
0
Thank you so much Wei. Really appreciate your after-sales customer service.
Posts: 6,340
Threads: 811
Joined: Oct 2020
Reputation:
156
Posts: 20
Threads: 2
Joined: Apr 2022
Reputation:
0
I tried as you mentioned. But only relay 1 comes on. I believe it has something to do with the following command.
value_template: '{{ value_json.relay1.on }}'
Can you please check this out?
switch:
- name: 'output-1'
unique_id: output-1
state_topic: 'relay32/99f9caa4068e7805b09f9a6a/state'
command_topic: 'relay32/99f9caa4068e7805b09f9a6a/set'
payload_on: '{"relay1":{"on":1},"relay2":{"on":1},"relay3":{"on":1},"relay4":{"on":1},"relay5":{"on":1},"relay6":{"on":1},"relay7":{"on":1},"relay8":{"on":1},"relay9":{"on":1},"relay10":{"on":1},"relay11":{"on":1},"relay12":{"on":1},"relay13":{"on":1},"relay14":{"on":1},"relay15":{"on":1},"relay16":{"on":1},"relay17":{"on":1},"relay18":{"on":1},"relay19":{"on":1},"relay20":{"on":1},"relay21":{"on":1},"relay22":{"on":1},"relay23":{"on":1},"relay24":{"on":1},"relay25":{"on":1},"relay26":{"on":1},"relay27":{"on":1},"relay28":{"on":1},"relay29":{"on":1},"relay30":{"on":1},"relay31":{"on":1},"relay32":{"on":1}}'
payload_off: '{"relay1":{"on":0},"relay2":{"on":0},"relay3":{"on":0},"relay4":{"on":0},"relay5":{"on":0},"relay6":{"on":0},"relay7":{"on":0},"relay8":{"on":0},"relay9":{"on":0},"relay10":{"on":0},"relay11":{"on":0},"relay12":{"on":0},"relay13":{"on":0},"relay14":{"on":0},"relay15":{"on":0},"relay16":{"on":0},"relay17":{"on":0},"relay18":{"on":0},"relay19":{"on":0},"relay20":{"on":0},"relay21":{"on":0},"relay22":{"on":0},"relay23":{"on":0},"relay24":{"on":0},"relay25":{"on":0},"relay26":{"on":0},"relay27":{"on":0},"relay28":{"on":0},"relay29":{"on":0},"relay30":{"on":0},"relay31":{"on":0},"relay32":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
Posts: 6,340
Threads: 811
Joined: Oct 2020
Reputation:
156
08-21-2023, 12:28 AM
(This post was last modified: 08-21-2023, 12:31 AM by admin.)
i have tested , no any problem. this is sample config for turn ON 16CH relay and turn OFF 16CH relay by "output-1" button in dashboard.
- name: 'output-1'
unique_id: output-1
state_topic: 'server/8ae082ec66f37db231cf2b8f/state'
command_topic: 'server/8ae082ec66f37db231cf2b8f/set'
payload_on: '{"relay1":{"on":1},"relay2":{"on":1},"relay3":{"on":1},"relay4":{"on":1},"relay5":{"on":1},"relay6":{"on":1},"relay7":{"on":1},"relay8":{"on":1},"relay9":{"on":1},"relay10":{"on":1},"relay11":{"on":1},"relay12":{"on":1},"relay13":{"on":1},"relay14":{"on":1},"relay15":{"on":1},"relay16":{"on":1}}'
payload_off: '{"relay1":{"on":0},"relay2":{"on":0},"relay3":{"on":0},"relay4":{"on":0},"relay5":{"on":0},"relay6":{"on":0},"relay7":{"on":0},"relay8":{"on":0},"relay9":{"on":0},"relay10":{"on":0},"relay11":{"on":0},"relay12":{"on":0},"relay13":{"on":0},"relay14":{"on":0},"relay15":{"on":0},"relay16":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
here is my config yaml file, you can compare, whether have syntax issue.
config.zip (Size: 3.94 KB / Downloads: 145)
|