Some advises for creating a new mqtt-homie device for using with OH2.4

Hello,

I’ve made some IOT devices to automate my home and now I want to make them work with OH2.4. To achieve that, I’m using homie 4 convention.

One of my devices has 7 inputs (for pulsers) and 7 outputs (for lamps).

The output part is already working: I’ve made a node called “switches” with $type = switch and 7 properties called from 1, 2, 3, …, 7. Each propertie has $datatype boolean.

The second part is the inputs. I’d like to make them show on OH as triggers or buttons to be able later to create a rule like:

When
button1 is PRESSED
Then
toggle switch1

I’ll paste here the mqtt bus output when I register my device, I hope someone could give me some hints on it.

  • Platform information:
    • Hardware: x86_64
    • OS: ubuntu 16.04
    • Java Runtime Environment: java version “1.8.0_201”
    • openHAB version: 2.5

MQTT when registering my device:

homie/nexPK-34/$state init
homie/nexPK-34/$homie 4.0.0
homie/nexPK-34/$name NexHome Power Key 34
homie/nexPK-34/$nodes switches,sensors
homie/nexPK-34/switches/$name Power Switches
homie/nexPK-34/switches/$type switch
homie/nexPK-34/switches/$properties 1,2,3,4,5,6,7
homie/nexPK-34/switches/1/$name Power Switch 1
homie/nexPK-34/switches/1/$settable true
homie/nexPK-34/switches/1/$retained true
homie/nexPK-34/switches/1/$datatype boolean
homie/nexPK-34/switches/2/$name Power Switch 2
homie/nexPK-34/switches/2/$settable true
homie/nexPK-34/switches/2/$retained true
homie/nexPK-34/switches/2/$datatype boolean
homie/nexPK-34/switches/3/$name Power Switch 3
homie/nexPK-34/switches/3/$settable true
homie/nexPK-34/switches/3/$retained true
homie/nexPK-34/switches/3/$datatype boolean
homie/nexPK-34/switches/4/$name Power Switch 4
homie/nexPK-34/switches/4/$settable true
homie/nexPK-34/switches/4/$retained true
homie/nexPK-34/switches/4/$datatype boolean
homie/nexPK-34/switches/5/$name Power Switch 5
homie/nexPK-34/switches/5/$settable true
homie/nexPK-34/switches/5/$retained true
homie/nexPK-34/switches/5/$datatype boolean
homie/nexPK-34/switches/6/$name Power Switch 6
homie/nexPK-34/switches/6/$settable true
homie/nexPK-34/switches/6/$retained true
homie/nexPK-34/switches/6/$datatype boolean
homie/nexPK-34/switches/7/$name Power Switch 7
homie/nexPK-34/switches/7/$settable true
homie/nexPK-34/switches/7/$retained true
homie/nexPK-34/switches/7/$datatype boolean
homie/nexPK-34/sensors/$name Sensors
homie/nexPK-34/sensors/$type trigger
homie/nexPK-34/sensors/$properties 1,2,3,4,5,6,7
homie/nexPK-34/sensors/1/$name Sensor 1
homie/nexPK-34/sensors/1/$settable false
homie/nexPK-34/sensors/1/$retained true
homie/nexPK-34/sensors/1/$datatype enum
homie/nexPK-34/sensors/1/$format PRESSED,RELEASED
homie/nexPK-34/sensors/2/$name Sensor 2
homie/nexPK-34/sensors/2/$settable false
homie/nexPK-34/sensors/2/$retained true
homie/nexPK-34/sensors/2/$datatype enum
homie/nexPK-34/sensors/2/$format PRESSED,RELEASED
homie/nexPK-34/sensors/3/$name Sensor 3
homie/nexPK-34/sensors/3/$settable false
homie/nexPK-34/sensors/3/$retained true
homie/nexPK-34/sensors/3/$datatype enum
homie/nexPK-34/sensors/3/$format PRESSED,RELEASED
homie/nexPK-34/sensors/4/$name Sensor 4
homie/nexPK-34/sensors/4/$settable false
homie/nexPK-34/sensors/4/$retained true
homie/nexPK-34/sensors/4/$datatype enum
homie/nexPK-34/sensors/4/$format PRESSED,RELEASED
homie/nexPK-34/sensors/5/$name Sensor 5
homie/nexPK-34/sensors/5/$settable false
homie/nexPK-34/sensors/5/$retained true
homie/nexPK-34/sensors/5/$datatype enum
homie/nexPK-34/sensors/5/$format PRESSED,RELEASED
homie/nexPK-34/sensors/6/$name Sensor 6
homie/nexPK-34/sensors/6/$settable false
homie/nexPK-34/sensors/6/$retained true
homie/nexPK-34/sensors/6/$datatype enum
homie/nexPK-34/sensors/6/$format PRESSED,RELEASED
homie/nexPK-34/sensors/7/$name Sensor 7
homie/nexPK-34/sensors/7/$settable false
homie/nexPK-34/sensors/7/$retained true
homie/nexPK-34/sensors/7/$datatype enum
homie/nexPK-34/sensors/7/$format PRESSED,RELEASED
homie/nexPK-34/$extensions (null)
homie/nexPK-34/$state ready

Thanks

Renato