openhab / openhab-addons

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

[Netatmo] Floodlight not working on Presence Camera (with siren) #14458

Closed multimartin closed 1 year ago

multimartin commented 1 year ago

I am on OH3.4 and have an issue with the Netatmo binding related to the floodlight function on my Netatmo Presence Outdoor camera (with siren).

The floodlight on/off/auto simply does not work according to docs: Netatmo - Bindings | openHAB

My floodlight works fine using either Homekit, the Netatmo app and through the Netatmo api (https://dev.netatmo.com/) - but not through OH. Everything else through OH seem to work fine (camera/snapshots etc).

The docs describe the channel as a switch - but with three states (on, off or auto). Perhaps that is the issue ?

(EDIT: the enhancement request regarding the siren function has been cut out of the text above and put into a seperate issue)

openhab-bot commented 1 year ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/floodlight-on-netatmo-presence-outdoor-camera/143153/2

clinique commented 1 year ago

Could you split your issue in two ? One is an enhancement, the other a potential bug. Let's keep the bug part in this one. Thanks.

clinique commented 1 year ago

The floodlight on/off/auto simply does not work according to docs: Netatmo - Bindings | openHAB

Does the binding report correctly the current status of the flood light if activated/deactivated by movement or Netatmo App ? (my Presence does not work anymore so I'm unable to test this currently).

multimartin commented 1 year ago

No, the binding does not report the change of status (on, off, auto) when change is done in the netatmo app (or through the api).

In OH UI the channel is of type string, as is my item. This makes sense as the state can be either on, off or auto.

The docs refer to the channel as a switch, but that myst be a typo…

clinique commented 1 year ago

Ok, thanks. I'm going to try to address this issue that may not have been heavily tested or used since the global binding revamp. I'll probably need your help - get ready to switch the binding in trace mode -, because as said my Presence is out of order.

multimartin commented 1 year ago
2023-02-22 09:53:32.565 [TRACE] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homestatus?home_id=607XXXXXXXXXXXXXXXXXXX 
2023-02-22 09:53:33.136 [TRACE] [mo.internal.handler.ApiBridgeHandler] - executeUri returned : code [200 OK] body {"status":"ok","time_server":1677056013,"body":{"home":{"id":"607XXXXXXXXXXXXXXXXXXX","modules":[{"id":"70:XX:XX:XX:XX:XX","type":"NSD","firmware_revision":1150,"last_seen":1675145355,"wifi_strength":61},{"id":"70:eX:XX:XX:XX:XX","type":"NOC","firmware_revision":3010000,"wifi_state":"high","wifi_strength":64,"sd_status":4,"alim_status":2,"siren_status":"no_sound","vpn_url":"https://prodvpn-eu-12.netatmo.net/restricted/10.xx.xx.xx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,,","is_local":true,"floodlight":"off","monitoring":"on"}]},"errors":[{"code":6,"id":"70:XX:XX:XX:XX:XX"}]}}
clinique commented 1 year ago

I think there is an error in the documentation. The channel is clearly a String, accepting ON/OFF/AUTO ( so could be linked to a Switch item also probably). Maybe the API used to activate this function has changed. Will take a look (in the current version the binding emulates the access like if it was the Netatmo App - this function was not documented back in the past IIRW).

multimartin commented 1 year ago

The .jar file you sent me a link to in the seperate issue related to the siren on this camera, seem to work regarding the floodlight issue; I can now turn on / off the floodlight - and it seems to sync with changes done in the Netatmo app. So far so good - however the .jar file only works for OH 4, / Java 17 - so I will wait until I migrate/upgrade my production setup until I can benefit from this... I guess you can consider the issue closed ?

lolodomo commented 1 year ago

I merged the PR.