andig / homebridge-fritz

Homebridge platform for Fritz!Box router and supported DECT devices
MIT License
74 stars 22 forks source link

Support battery level for Italian Fritz!OS #99

Open giannimp opened 4 years ago

giannimp commented 4 years ago

Hi, thank you for your work, I Have a problem battery level in homekit

In homekit the battery level of the heads is not displayed, as an account in the config I enter the administrative one with all the permissions [Homebridge] [12/30/2019, 4:27:37 PM] [Fritzbox7590] Updating thermostat 099950167xxx [Homebridge] [12/30/2019, 4:27:37 PM] [Fritzbox7590] Getting thermostat 099950167xxx temperature [Homebridge] [12/30/2019, 4:27:37 PM] [Fritzbox7590] Getting thermostat 099950167xxx target temperature [Homebridge] [12/30/2019, 4:27:37 PM] [Fritzbox7590] Getting thermostat 099950167xxx battery level [Homebridge] [12/30/2019, 4:27:38 PM] [Fritzbox7590] Getting thermostat 099950167xx battery status [Homebridge] [12/30/2019, 4:27:38 PM] [Fritzbox7590] Updating thermostat 119610841xxx [Homebridge] [12/30/2019, 4:27:38 PM] [Fritzbox7590] Getting thermostat 119610841xxx temperature [Homebridge] [12/30/2019, 4:27:38 PM] [Fritzbox7590] Getting thermostat 119610841xxx target temperature [Homebridge] [12/30/2019, 4:27:38 PM] [Fritzbox7590] Getting thermostat 119610841xxx battery level [Homebridge] [12/30/2019, 4:27:38 PM] [Fritzbox7590] Getting thermostat 119610841xxx battery status

andig commented 4 years ago

Which language of FritzOS are you using?

giannimp commented 4 years ago

Italian

andig commented 4 years ago

Then thats the problem as its not found by the regex. Could you share a screenshot?

giannimp commented 4 years ago

3C6D7F13-9539-4025-B549-E48AFAA7B136 ![Uploading A90F94EB-52C3-47AA-9D97-26E98F5606D1.png…]()

giannimp commented 4 years ago

image

giannimp commented 4 years ago

Hi, Happy new year 2020! Have you news for my issue?

Supereg commented 4 years ago

This is probably more an issue of andig/fritzapi.

Could you simplify your regex pattern to match the percent symbol so any language works @andig?

andig commented 4 years ago

Right now we're looking for a label that contains battery: https://github.com/andig/fritzapi/blob/master/index.js#L636

giannimp commented 4 years ago

Hi, @andig have you news?

andig commented 4 years ago

No, should I? I've shown the line where it happens, please feel try to adapt as needed. If you can find something that will work for Italian and other devices I'd be happy to update accordingly.

Supereg commented 4 years ago

Could somebody provide a sample html file from the site being parsed @andig?

Supereg commented 4 years ago

Any updates? If somebody could send me the html source code of the fritz page the battery percentage is queried from I could maybe come up with a more general regex which supports more languages.

cc @andig @giannimp