Comments (6)
Hi,
der Ladezustand der Batterie ist jetzt in Version 1.7.0 integriert. Leider habe ich noch ein paar Probleme mit der Umsetzung der Token-Verschlüsselung, daher kann ich die Version noch nicht freigeben.
Gruß
Sven
from iobroker.nuki.
I had another look at the API and found that actually the %-value can be provided by the bridge.
I'm going to implement this in the next version.
from iobroker.nuki.
Hi there,
this is a nice suggestion. But this adapter is based on the latest NUKI bridge API which doesn't deliver this information. I'm guessing the percentage you are receiving in the app is brought to you via direct Blutooth connection or maybe via NUKI web API. Till now these connection types are not supported by this adapter.
Sorry.
Regards
Sven
from iobroker.nuki.
Hi Sven,
vielen Dank für die Programmierung des Adapters. Funktioniert bestens.
Ich hätte auch großes Interesse an einem Prozentwert des Akkus. Hast Du das bereits eingebaut und ich habs übersehen?
Vielen Dank & viele Grüße
Tom
from iobroker.nuki.
Vielen Dank für das Update und die Mühe. Gibt es hier eventuell schon etwas Neues? Leider aktuallisiert sich der Akkustand nur bei einem Neustart des Adapters.
from iobroker.nuki.
Hi, ich habe das per JS in ioBroker so gelöst:
// V24.04.001
// Nuki Smart Lock Battery Status
//
// Dieses Skript überwacht den Batteriestatus eines Nuki Smart Lock (Version 3 oder 4), das mit einer Nuki Bridge verbunden ist.
// Die Batteriestatusinformationen werden regelmäßig abgerufen und in einem ioBroker-Datenpunkt (dataPath) gespeichert.
const axios = require('axios');
// Pfad für die Datenpunkte
var dataPath = "javascript.0.nuki-battery-state";
// URL für die NUKI Bridge API-Anfrage (ersetze <bridge_ip> und <token> durch deine Werte)
var url = "http://<bridge_ip>:8080/list?token=<token>";
// Funktion zur Aktualisierung eines Zustands, falls vorhanden, oder zur Erstellung eines neuen Zustands
function updateOrCreateState(path, value, callback) {
getObject(path, function (err, obj) {
if (!err && obj) {
// Der Zustand existiert bereits, aktualisiere ihn
setState(path, value, true, callback);
} else {
// Zustand erstellen
createState(path, value, true, callback);
}
});
}
// Funktion zum Abrufen und Speichern des Batteriestatus
function saveBatteryStatus() {
axios.get(url).then(response => {
// Überprüfe, ob die Antwort ein Array mit mindestens einem Element enthält
if (response.data && response.data.length > 0) {
// Zugriff auf den Batterieladestatus des ersten Geräts
var batteryChargeState = response.data[0].lastKnownState.batteryChargeState;
// Speichern des Wertes in ioBroker
updateOrCreateState(dataPath + ".batteryChargeState", batteryChargeState, function () {});
}
}).catch(error => {
log("Fehler beim Abrufen des Batteriestatus: " + error);
});
}
// Initialer Aufruf der Funktion, um den Batteriestatus sofort zu speichern
saveBatteryStatus();
// Funktion zur regelmäßigen Aktualisierung (täglich)
schedule("0 0 * * *", function () {
saveBatteryStatus();
});
Beim ersten Ausführen des JS und falls der Datenpunkt noch nicht angelegt wurde, tritt der Fehler „Object can't be copied: {}“ auf. Dies deutet wohl auf eine Problematik bei der Adressierung des Datenpunktes hin, sofern dieser noch nicht existiert. Trotz dieses Fehlers funktioniert das Skript in meinem Fall einwandfrei, weswegen dieser Fehler meiner Einschätzung nach ignoriert werden kann.
PS: benötigt Smart Lock Firmware 2.8.1/1.10.0 oder höher
from iobroker.nuki.
Related Issues (20)
- action xy not successfully set! HOT 5
- Adapter adaptation to the current API HOT 4
- Nuki 3.0 HOT 4
- Usage of Nuki 3.0 pro with your adapter HOT 4
- feature for activating and deactivating auto unlock HOT 1
- Update stable version in repo from 1.5.0 to 1.6.0 HOT 1
- hasOwnProperty fatal error HOT 7
- Think about to fix the issues found by adapter checker HOT 1
- Compatibility check to js-controller 4.0
- Adapter Nuki Smart Lock 1.6.0 installed, API fetched from nuki.io BUT an error is thrown in IOBroker's log HOT 14
- Software Bridge fail HOT 2
- Exception-Code: EADDRINUSE: listen EADDRINUSE: address already in use 192.168.X.XX:9092 HOT 5
- Error: read ECONNRESET HOT 3
- warn .info.keypadBatteryCritical HOT 2
- Protokoll HOT 1
- warnung im log HOT 2
- Warnung, obwohl erfolgreich HOT 4
- Make web api accessible
- Bridge zeigt bei jeder Aktion im Protokoll "Nuki device is offline" obwohl Aktion einwandfrei ausgeführt wird. HOT 3
- Is NUKI Smart Lock Pro 4th Generation being supported? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iobroker.nuki.