seydx / homebridge-fritz-platform

AiO Homebridge dynamic platform plugin for AVM hardware like Fritz!Box, Fritz!Repeater etc.
MIT License
222 stars 32 forks source link

Battery level for contact sensor #118

Open MrWGT opened 3 years ago

MrWGT commented 3 years ago

I use the following config:

{ "accType" : "thermostat", "ain" : "099950409035", "battery" : true, "name" : "Heizung Leana", "temperature" : true, "window" : false }, { "accType" : "window", "ain" : "099950409035", "battery" : true, "name" : "Fenstererkennung KiZi" },

Same AIN but battery is reported correct as Thermostat but not as window.

Battery level is also wrong on HAN-FUN optical window contact:

{ "accType" : "contact", "ain" : "119340208370", "battery" : true, "name" : "Kleines Fenster KiZi" },

In both cases the battery is reported as empty but shown as 90 or 100% in web interface of fritz box.

seydx commented 3 years ago

@MrWGT

Thy i will check this

seydx commented 3 years ago

@MrWGT

I can not reproduce this atm. Need to find a empty battery to check it 😅

MrWGT commented 3 years ago

@MrWGT

I can not reproduce this atm. Need to find a empty battery to check it 😅

The battery is not empty. It's just shown as empty. 😅

MrWGT commented 3 years ago

The thermostat and the window contact have the same AIN. Thermostat is configured as window = false. Window contact (from Thermostat) as separate device shows empty battery. But thermostat not.

MrWGT commented 3 years ago

[2020-11-15 16:35:30] The plugin "homebridge-fritz-platform" requires Node version of >=12.18.3 which does not satisfy the current Node version of v12.16.1. You may need to upgrade your installation of Node.

Could this be the reason?

seydx commented 3 years ago

@MrWGT

No node is not causing that, i will check the batter again

seydx commented 3 years ago

@MrWGT

Hat dein Kontaktsensor auch eine Batterieanzeige auf der FritzBox Oberfläche?

MrWGT commented 3 years ago

Ja, es ist ein HAN-FUN Sensor von der Telekom. Dieser wird von der Fritzbox unterstützt.

Anzeige in der Oberfläche "Batterie OK". Keine Prozent.

MrWGT commented 3 years ago

Bilder von Eve und Fritzbox hier:

https://1drv.ms/f/s!Assv5fIy-dXzgpdU1Kq0LoS_mfrySA

seydx commented 3 years ago

@MrWGT

Window habe ich gefixt, kommt mit der nächsten Version. Bei den Kontaktsensoren ist es etwas schwieriger. Die Batterie zeigt keine Prozentzahl an und ich weiß nicht woher die FritzBox Anzeige den Status "OK" her hat weil es nicht in der API definiert ist.

MrWGT commented 3 years ago

In der vorherigen Version des Plugins 4.x ging es. Es wurde kein Fehler angezeigt.

seydx commented 3 years ago

@MrWGT

Wurde die richtige Prozentzahl angezeigt beim Kontaktsensor?

MrWGT commented 3 years ago

Hm... Weiß ich leider nicht mehr. Es war zumindest keine Warnung "Batterie leer" da.

seydx commented 3 years ago

@MrWGT

das liegt daran weil die alte Version überhaupt keine Batterianzeige hatte.

v5.0.12 ist online. Bitte einmal updaten und den Eintrag für Batterie im config für den Kontaktsensor entfernen oder auf false setzen. Anschließen hb neustarten. Sollte fixen.

MrWGT commented 3 years ago

Habe ich gemacht und funktioniert jetzt. Nur der echte Fensterkontakt bleibt noch übrig 😅

Danke 😀

seydx commented 3 years ago

@MrWGT

Der echte Fensterkontakt?

MrWGT commented 3 years ago

Ja. Derjenige welcher keine Prozent anzeigt.

https://www.smarthome.de/geraete/smarthome-tuer-fensterkontakt-optisch-weiss

Den habe ich bei Ebay für 15€ neu bekommen.

Auf und Zu werden sicher und schnell erkannt. Fritzbox 7590 zeigt den als HAN-FUN an und Batterie als OK ohne Prozent

MrWGT commented 3 years ago

Habe mal das Debug-Log angeschalten:

16.11.2020, 22:27:25 - [FritzPlatform] Kleines Fenster KiZi: Polling state (smarthome-window)... 16.11.2020, 22:27:25 - [FritzPlatform] Kleines Fenster KiZi: {"name":"Kleines Fenster KiZi","ain":"119340208370-1","online":1,"bitmask":"8208","busy":0,"battery":false,"alert":{"state":0},"temperature":false,"powermeter":false,"switch":false,"button":false,"thermostat":false,"light":false}

Hilft das was?

seydx commented 3 years ago

@MrWGT

Gut gemeint, leider nicht. Da die Anzeige da von mir manipuliert ist und wie du siehst steht da "battery": false - was aber nicht heißen muss das die API keine Informationen dazu hergibt

Müsste ein kleines debug modul entwerfen für dich was ALLE API daten ohne manipulation anzeigt. Villeicht finden wir da was brauchbares