kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
176 stars 33 forks source link

Add door sensor battery % #45

Open KitHubek opened 2 years ago

KitHubek commented 2 years ago

Please add door sensor battery state and % https://nuki.io/en/door-sensor/

I have one, and working ok with this integration, but missing batterry state of this device

kvj commented 2 years ago

I don't own the door sensor (the active one).

Could you please provide JSON outputs of the bridge /list call and/or web API /smartlock call?

KitHubek commented 2 years ago

ok i can do this, but please write how to do this? I dont know web API

kvj commented 2 years ago

Have you configured the web API token?

If yes, then you can make a curl (or whatever you prefer) call to the https://api.nuki.io/smartlock, additionally setting HTTP header Authorization: Bearer YOUR_WEB_TOKEN

andischweig commented 2 years ago

Hey, maybe i can help:

      "state":{
         "mode":2,
         "state":1,
         "trigger":3,
         "lastAction":2,
         "batteryCritical":false,
         "batteryCharging":false,
         "batteryCharge":82,
         "keypadBatteryCritical":false,
         "doorsensorBatteryCritical":false,
         "doorState":2,
         "ringToOpenTimer":0,
         "nightMode":true
      },