05-16-2022, 03:41 PM
(12-13-2021, 12:25 AM)admin Wrote: improvement:
add mqtt "TOGGLE" command.
for example:
Payload={"relay1":{"on":1}} relay1:ON
Payload={"relay1":{"on":0}} relay1:OFF
Payload={"relay1":{"on":2}} relay1: toggle (ON->OFF or OFF->ON) new firmware add this command
download the ZIP file , unzip update the bin file for KC868-H32BS relay controller by USB-RS232 cable.
What should i add on the home assistant, this is my configuration for relay1:
- platform: mqtt
name: 'Spot 405'
unique_id: spot-405
state_topic: 'relay32/007cdf3371b9d0bbb7ffxxxx/state'
command_topic: 'relay32/007cdf3371b9d0bbb7ffxxxx/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0