Camera type NOC / change floodlight through api/setstate
Hi,
I have a basic implementation of viewing live streaming of a Netatmo NOC Camera and I only use api/homestatus to achieve this.
So i retrieve the vpn_url, then appending "live/index.m3u8" to this value, and open it from a mediaplayer.
GET https://api.netatmo.com/api/homestatus?device_types=NOC&device_types=NACamera&home_id=xxxxI would like to implement now
Status code: 200
Response: {
"status" : "ok",
"time_server" : 1760558554,
"body" : {
"home" : {
"id" : "xxxx",
"modules" : [
{
"floodlight" : "off",
"wifi_state" : "full",
"wifi_strength" : 39,
"id" : "module_id",
"vpn_url" : "vpn_url",
"monitoring" : "on",
"firmware_revision" : 3026000,
"type" : "NOC",
"sd_status" : 4,
"alim_status" : 2,
"is_local" : false
}
]
}
}
}
floodlight - auto/on/off
monitoring - on/off : But I doubt it's possible since it's not mentioned into documentation, and then, after digging for my problem, I found this one: https://github.com/openhab/openhab-addons/issues/14617#issuecomment-1495546551
monitoring - on/off : But I doubt it's possible since it's not mentioned into documentation, and then, after digging for my problem, I found this one: https://github.com/openhab/openhab-addons/issues/14617#issuecomment-1495546551
I have the same issue for this following request, switch on floodlight through api :
curl -X POST https://api.netatmo.com/api/setstate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my-working-bearer-for-previous-request" \
-d '{
"home": {
"id": "homeId", (found in previous request)
"modules": [
{
"floodlight": "on",
"id": "module_id" (found in previous request)
}
]
}
}'
And response is :
And response is :
{"error":{"code":21,"message":"Invalid device_id, 70:ee:50:55:f6:ee"}}
The much funny thing is I had the exact same request sent from Netatmo Security app, with same home_id & module_id
Here is an example of request sent from netatmo app
The much funny thing is I had the exact same request sent from Netatmo Security app, with same home_id & module_id
Here is an example of request sent from netatmo app
accept: */*
content-type: application/json; charset=utf-8
x-correlationid: 15961355151
content-length: 132
authorization: Bearer token
accept-language: fr-FR;q=1.0, en-FR;q=0.9
user-agent: NetatmoSecurity/6.16.1 (com.netatmo.camera; build:1161; iOS 18.6.2) Alamofire/5.10.2
accept-encoding: br;q=1.0, gzip;q=0.9, deflate;q=0.8
{
"home": {
"modules": [
{
"id": "module_id",
"floodlight": "on"
}
],
"id": "home_id"
},
"app_identifier": "app_security"
}
Someone could explain what's happen here ?
Thanks to all :)
Someone could explain what's happen here ?
Thanks to all :)
Commentaires
2 commentaires
Found.
I do not have "write_presence" scope.
But documentation https://dev.netatmo.com/apidocumentation/security#setstate suggests we need it, but OAuth part do not exposes it https://dev.netatmo.com/apidocumentation/oauth#scopes.
lit.
Hello Frederic,
I create two scripts (thanks to @leslie for her help) to:
1/ manage tokens
2/ manage floodlight via a button connected using zigbee to domoticz, but of course it can be anything else
You may have a look here https://github.com/Phil353556/netatmo-floodlight and https://github.com/Phil353556/netatmo-manage-tokens
Thanks
Phil
Vous devez vous connecter pour laisser un commentaire.