Setting up GPIO pins in openHAB #107
-
Discussion started in #79 by @Veldhius123 i have change the configuration but it don't work. at the moment I am not coping very well with it, but it is getting better
this is my openHab configuration
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I suggest you read through the documentation of MQTTany and the MQTT binding in openHAB to get more familiar with both. You will also find examples for the MQTT binding on the openHAB forum. I will give you some examples for the pin you are trying to setup to get you started. The The rest of the topic is also wrong, as I stated in my response in #79. You have removed the If I understand correctly, you want to have several numbered relays configured. Based on that you could use this configuration: gpio:
channels:
pin: [26, 27] # a list of the pins your relays are connected to, in the order you want them numbered
name: 'channel{index}'
pin mode: output
first index: 1 That will give you GPIO26 on the topic UID: mqtt:topic:openhab:channel1
label: Channel 1
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:openhab
channels:
- id: relay
channelTypeUID: mqtt:switch
label: Channel 1 Relay
description: ""
configuration:
commandTopic: raspberrypi/gpio/channel1/set
stateTopic: raspberrypi/gpio/channel1
on: ON
off: OFF UID: mqtt:topic:openhab:channel2
label: Channel 2
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:openhab
channels:
- id: relay
channelTypeUID: mqtt:switch
label: Channel 2 Relay
description: ""
configuration:
commandTopic: raspberrypi/gpio/channel2/set
stateTopic: raspberrypi/gpio/channel2
on: ON
off: OFF |
Beta Was this translation helpful? Give feedback.
I suggest you read through the documentation of MQTTany and the MQTT binding in openHAB to get more familiar with both. You will also find examples for the MQTT binding on the openHAB forum.
I will give you some examples for the pin you are trying to setup to get you started.
The
root topic
defaults to being the same as theclient id
, which defaults to the hostname of the system. You have your topics in openHAB using a root of10.0.10.200
, but that is the address of your MQTT server. From your command promptpi@raspberrypi: ~ $
you can see that the hostname israspberrypi
, therefore MQTTany is connecting using the nameraspberrypi
and the root topic is alsoraspberrypi
.The rest of the to…