Hi all,
after a long time of trial and error, I have figured out the following binding and I’d like to have some feedback from some “silverbacks” in this forum.
Setup:
- Raspi 4+
- Openhab (Version 2.5.3)
- HW: NodON PIR (PIR 2-1-01) and NodOn SmartPlugSwitch (MSP-2-1-11)
Goal:
EnOcean Sensors/Actors should post changes (e.g. Motion, etc.) via MQTT and actors should receive MQTT commands and act accordingly.
Status:
Everything works as desired except that the switch sometimes does not respond to the MQTT message in the first place. If I switch again (sent MQTT message again) it works. I have the feeling that openHAB sometimes has issues with CPU resources and misses some commands.
Questions:
- Can you see anything that can be improved in my config?
- Any ideas why the switch misses some commands coming in via MQTT?
Thanks a lot.
Horst
Here are my config files:
EnOcean.things
Bridge enocean:bridge:gtwy "EnOcean Gateway.SCR" [ path="/dev/ttyAMA0", espVersion="ESP3", rs485=false, rs485BaseId="00000000" ]
{
Thing measurementSwitch MicroPlugSwitch "EnOcean MicroSwitch.SCR" @ "MicroSmartPlug" [ enoceanId="0582F709", senderIdOffset=1, sendingEEPId="D2_01_0E", receivingEEPId="D2_01_0E", broadcastMessages=false, suppressRepeating=false, pollingInterval=300] {
// Channels appear automatically somehow:
}
Thing occupancySensor EnOceanPIRSensorscr "EnOcean Occupancy.SCR" @ "NodON PIR" [ enoceanId="058AEC49", senderIdOffset=2, sendingEPPId="A5_07_03", receivingEEPId="A5_07_03", broadcastMessages=true, suppressRepeating=false, pollingInterval=300] {
Channels:
State Number : Illuminancescr "Lux" []
State Number : batteryVoltagescr "Battery Voltage" []
State Switch : motionDetectionscr "Motion" []
}
}
MQTT.things
Bridge mqtt:broker:andimqttbroker "MQTT Broker.SCR" [host="192.168.0.2", secure=false]
{
Thing topic MQTTNodOnPIRSensor "MQTT Occupancy Sensor SCR" @ "NodON PIR"
{
Channels:
Type switch : PIRNodOn "PIR Sensor scr" [ stateTopic="openhab/PIR", commandTopic="openhab/PIR/set", retained=false, postCommand=false ]
Type number : PIRIllumi "PIR LUX scr" [ stateTopic="openhab/PIR/Lux", commandTopic="openhab/PIR/Lux", retained=false, postCommand=false]
Type number : PIRVoltage "PIR Voltage scr" [ stateTopic="openhab/PIR/Voltage", commandTopic="openhab/PIR/Voltage", retained=false, postCommand=false]
}
Thing topic MQTTNodOnMicroSmartPlug "MQTT MicroPlugSwitch SCR" @ "MicroSmartPlug"
{
Channels:
Type switch : MicroSmartPlugSwitch "MicroSmart On/Off" [ stateTopic="openhab/SmartPlug", commandTopic="openhab/SmartPlug/set", retained=false, postCommand=true ]
}
}
Sensors.items
// PIR Motion Sensor
Number batteryVoltagescrn "Battery Voltrage SCR" {channel="mqtt:topic:andimqttbroker:MQTTNodOnPIRSensor:PIRVoltage" [profile="system:follow"], channel="enocean:occupancySensor:gtwy:EnOceanPIRSensorscr:batteryVoltage"}
Number Illuminancescr "Lux SCR" {channel="mqtt:topic:andimqttbroker:MQTTNodOnPIRSensor:PIRIllumi" [profile="system:follow"], channel="enocean:occupancySensor:gtwy:EnOceanPIRSensorscr:illumination"}
Switch MQTTmotionDetectionscr "MQTT Motion" {channel="mqtt:topic:andimqttbroker:MQTTNodOnPIRSensor:PIRNodOn" [profile="system:follow"], channel="enocean:occupancySensor:gtwy:EnOceanPIRSensorscr:motionDetection" }
// MicroPlugSwitch
Switch CHMicroPlugSwitch "EnOcean.Switch2" {channel="mqtt:topic:andimqttbroker:MQTTNodOnMicroSmartPlug:MicroSmartPlugSwitch" [profile="system:follow"], channel="enocean:measurementSwitch:gtwy:MicroPlugSwitch:generalSwitch" }