andrasU / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1 stars 0 forks source link

Motion detector does not have any Channels #1

Closed andrasU closed 1 year ago

andrasU commented 1 year ago

Expected Behavior

Motion detector shall have Channels attached. ( 0x0011 FID_MOVEMENT_DETECTOR)

Current Behavior

Currently the motion detector have no Channels attached. ( 0x0011 FID_MOVEMENT_DETECTOR)

Possible Solution

Steps to Reproduce (for Bugs)

Your Environment

sleugner commented 1 year ago

Here is the Device Code from my Motion Sensor you asked for: I guess you have the channels already for the Weather Station or other devices.

{ "00000000-0000-0000-0000-000000000000": { "devices": { "ABB7F59A8111": { "floor": "02", "room": "11", "interface": "TP", "displayName": "Bewegungsmelder", "unresponsive": false, "channels": { "ch0000": { "displayName": "Bewegungsmelder", "functionID": "11", "inputs": { "idp0000": { "pairingID": 256, "value": "0" } }, "outputs": { "odp0000": { "pairingID": 6, "value": "1" }, "odp0001": { "pairingID": 7, "value": "1" }, "odp0002": { "pairingID": 1027, "value": "1.6" } } } } } } } }

andrasU commented 1 year ago

@sleugner. The motion detector channels are added. could you test this version?

fh-3.4.4-pre1

Thank you

sleugner commented 1 year ago

@andrasU The new Binding is working. I can see the three Channels. Motion Sensor But I think the Channel "Presence" is not mapped right. I think it is the same issue as with the Sensors. You have to map "ch0000.idp0000" to Presence. At the moment is only shows "On" all the time. The Input Channel shows if the Motion Sensor has detected anything. Then it turns to the Value 1. Otherwise it is 0 = not current detection. Thanks

sleugner commented 1 year ago

By the way. Do you have any idea how the Lux Value is translated? I have a Lux Level in the export from 1.6. There must be a logic behind it from Free@home that transfers Lux Value into Lux Levels.

andrasU commented 1 year ago

@sleugner I added the input datapoint to the binding. This is an input datapoint from the device point of view, however for the binding will act as an output.

Could you make a short test with this?

fh-3.4.4-pre2

This behaviour was a bit strange for me, because the only output datapoint shall show the output/sensing of the device. Even a sensor only device is reporting the sensing state on the output datapoint. But it could be different for the motion detector.

However it just came to my mind: The "Presence" Channel is called in the API "AL_TIMED_PRESENCE".. is there no configuration for some time constant? Could not be that the device will update the output datapoint also but after the time constant?

Just an idea... but now at least the input datapoint shall be available, and shall present the immediate sensing info.

Unfortunately, there is no a good documentation in the free@home API documentation for special device like movement detector :(

please give me a info whether this change worked for you Thank you

andrasU commented 1 year ago

By the way. Do you have any idea how the Lux Value is translated? I have a Lux Level in the export from 1.6. There must be a logic behind it from Free@home that transfers Lux Value into Lux Levels.

sorry I do not have any idea about the calculation formula. as I wrote in the last message the API documentation is not good for motion detector.

but a question is the bdingin reporting a value? at least it shall report a "decimal" value.

sleugner commented 1 year ago

Good eveninn ;) Something in the binding is off. I wasn't able to see the new Channel automaticly so I deleted my Motion Sensor as a thing. Now the binding is not finding the device anymore if I scan. Could you check again?

In the meantime I made two outputs from the motion sensor. First one is in darkness with no presence detected: { "00000000-0000-0000-0000-000000000000": { "devices": { "ABB7F59A83A9": { "floor": "02", "room": "11", "interface": "TP", "displayName": "Flur Vorratskammer", "unresponsive": false, "channels": { "ch0000": { "displayName": "Flur Vorratskammer", "functionID": "11", "inputs": { "idp0000": { "pairingID": 256, "value": "0" } }, "outputs": { "odp0000": { "pairingID": 6, "value": "1" }, "odp0001": { "pairingID": 7, "value": "1" }, "odp0002": { "pairingID": 1027, "value": "1.6" } } } } } } } }

The Second one is with motion detected and lights on { "00000000-0000-0000-0000-000000000000": { "devices": { "ABB7F59A83A9": { "floor": "02", "room": "11", "interface": "TP", "displayName": "Flur Vorratskammer", "unresponsive": false, "channels": { "ch0000": { "displayName": "Flur Vorratskammer", "functionID": "11", "inputs": { "idp0000": { "pairingID": 256, "value": "1" } }, "outputs": { "odp0000": { "pairingID": 6, "value": "1" }, "odp0001": { "pairingID": 7, "value": "1" }, "odp0002": { "pairingID": 1027, "value": "5.8" } } } } } } } }

So what you see is that the input Channel is changing from 0 to 1 if a presence is detected. Maybe the logic is that sensing a motion is an input for the motion sensor and this is what triggers it. Like pressing a button on the Sensors. The Output Channels have the Value 1 in both cases.

The odp.0002 is giving the brightness Value in Lux. At least this is what it sais. So darkness is 1.6 and normal lamp light is 5.8 in my case. And yes I was seeing the exact same value in the Channel in OpenHAB

Funny thing is that the brighness Alarm in the app has a trashhold of 20.000 lux. I also asked google how much Lux is lamp light and darkness but the sources are telling different storys. My guess is it is Lux but /1.000 or so.

andrasU commented 1 year ago

A new pre version is implemented, bug-fixes and mainly implementation of virtual devices. The scan is working in my tests. hopefully the motion detect is working as well.

fh-3.4.4-pre3

sleugner commented 1 year ago

Thanks for the new Version. THe Motion Sensor is there and I can see the fourth Channel. Thanks Bug can be closed