openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.7k forks source link

[Enocean] Handling movement detection from Telefunken BM1 PIR Sensor #5694

Closed SebastianSchork closed 5 years ago

SebastianSchork commented 5 years ago

I tried to get a "BM1 PIR+Temeprature Sensor (Telefunken)" to work with the Enocean add-on for OpenHab2. The temperature can be successfully handled as a "Numeric" item the following way:

Number BalconyTemperature "Balcony Temperature" [ "CurrentTemperature" ] { enocean="{id=00:85:8E:53, eep=A5:08:02, parameter=TEMPERATURE}" }

Unfortunately, the movement/PIR information cannot be read. After browsing through the add-on's code on GitHub I found converters for parameter type "MOVEMENT" (at least it seems like) using the OnOffConverter. I therefore tried without success:

Contact BalconyMovement "Balcony Movement" [ "CurrentMovement" ] { enocean="{id=00:00:00:00, eep=A5:08:02, parameter=MOVEMENT}" }

The log states the following:

2018-11-03 15:51:11.400 [WARN ] [an.internal.profiles.StandardProfile] - No converter found for EnoceanParameter: {id="00:85:8E:53", parameter="MOVEMENT"} - doing nothing.

Expected Behavior

Expected behavior would be to receive updates on the PIR/movement sensor of the BM1.

Current Behavior

Sensor is not considered and "no converter found" message is logged.

Context

Trying to integrate a movement/PIR sensor.

Your Environment

OpenHab 2, binding-enocean1 (1.12.0)

9037568 commented 5 years ago

movement appears to be set up as an OnOffType. A Contact is an OpenClosedType.

Have you tried using a Switch instead?

Switch BalconyMovement "Balcony Movement" [ "CurrentMovement" ] { enocean="{id=00:00:00:00, eep=A5:08:02, parameter=MOVEMENT}" }
SebastianSchork commented 5 years ago

I will try to change it to Switch ASAP and I will report back here. Thank you very much.

The only negative side effect a switch would have is that it can be written to. This is why a contact as read-only seemed to be the more plausible option. Still, I will try it out.

SebastianSchork commented 5 years ago

movement appears to be set up as an OnOffType. A Contact is an OpenClosedType.

Have you tried using a Switch instead?

Switch BalconyMovement "Balcony Movement" [ "CurrentMovement" ] { enocean="{id=00:00:00:00, eep=A5:08:02, parameter=MOVEMENT}" }

It works perfectly, thank you very much again for this suggestion.