I have already installed mosquit MQTT broker on the PI4, now it’s online. my relay board support MQTT. it have 8 relay output, there is command and state topic. but the payload have feedback all relays states, not individual. this board, i have already integrate with home assistant with MQTT. now can you tell me the fast way use for openHAB.
this is I config with home assistant:
switch:
– platform: mqtt
name: ‘relay1’
unique_id: relay1
state_topic: ‘relay1/xxxxxxxxxxxxxxxxxxxxxxxx/state’
command_topic: ‘relay1/xxxxxxxxxxxxxxxxxxxxxxxx/set’
payload_on: ‘{“relay1”:{“on”:1}}’
payload_off: ‘{“relay1”:{“on”:0}}’
value_template: ‘{{ value_json.relay1.on }}’
state_on: 1
state_off: 0
xxxxxxxxxxxxxx is board ID
can you tell me how to config with openHAB, thanks.