-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include Smart Home / DECT devices? #44
Comments
Hi, Due to the lack of a Fritz!DECT Smart home device I can't get the readings and implement the measurements. Can you post the Lua API output here? You need to browser to the page of the FritzBox where the values are shown. Then open your browsers developer tools and get the full json output of the Thank you. |
Sorry, I tried to find that data.lua but didn't find it anywhere. Isn't there a .lua link to call dect devices? |
Something like this: However, this wouldn't work for me and I don't know why. |
Ahh ok, for this data it seems to be |
I actually can't get to the desired data, because I can't get a valid session id, like I mentioned in the above comment. There is no way to access any lua api data, w/o a valid sid. Mine is always reverted back to 000...., which is invalid. |
I may have already accomplished what you are trying to do using the TR-069 protocol. For each device I added the following to {
"name": "X_AVM-DE_Homeauto",
"interval": 120,
"actions": [{
"name": "GetGenericDeviceInfos",
"params": {
"NewIndex": 0
}
}],
"value_instances": {
"NewAIN": "home0_ain",
"NewDeviceName": "home0_devicename",
"NewPresent": "home0_present",
"NewTemperatureIsEnabled": "home0_temp_enabled",
"NewTemperatureIsValid": "home0_temp_valid",
"NewTemperatureCelsius": "home0_temp_celsius",
"NewTemperatureOffset": "home0_temp_offset",
"NewMultimeterIsEnabled": "home0_multimeter_enabled",
"NewMultimeterIsValid": "home0_multimeter_valid",
"NewMultimeterPower": "home0_multimeter_power",
"NewMultimeterEnergy": "home0_multimeter_energy",
"NewHkrIsEnabled": "home0_heating_enabled",
"NewHkrIsValid": "home0_heating_valid",
"NewHkrIsTemperature": "home0_heating_istemperature",
"NewHkrSetVentilStatus": "home0_heating_setventil",
"NewHkrSetTemperature": "home0_heating_settemperature",
"NewHkrSetTemperature": "home0_heating_settemperature",
"NewHkrReduceVentilStatus": "home0_heating_reduceventil",
"NewHkrReduceTemperature": "home0_heating_reducetemperature",
"NewHkrComfortVentilStatus": "home0_heating_comfortventil",
"NewHkrComfortTemperature": "home0_heating_comforttemperature"
}
} My Flux query joins But if you just ignore the |
@matthiasstock Hi, this already looks promising. Are these values are also available via the web interface? Are you able to check if this data can be extracted via Tank you. |
I am able to query the temperatures using this endpoint. curl -s -H 'Accept: application/json' "http://fritz.box/webservices/homeautoswitch.lua?sid=${mysid}&switchcmd=getdevicelistinfos" However, I get XML instead of JSON. Does this already help or what else should I try? <?xml version="1.0"?>
<devicelist version="1" fwversion="7.29">
<device identifier="09995 0733992" id="16" functionbitmask="320" fwversion="05.02" manufacturer="AVM" productname="FRITZ!DECT 301">
<present>1</present>
<txbusy>0</txbusy>
<name>Zimmer 1</name>
<battery>70</battery>
<batterylow>0</batterylow>
<temperature>
<celsius>260</celsius>
<offset>0</offset>
</temperature>
<hkr>
<tist>52</tist>
<tsoll>253</tsoll>
<absenk>38</absenk>
<komfort>42</komfort>
<lock>1</lock>
<devicelock>0</devicelock>
<errorcode>0</errorcode>
<windowopenactiv>0</windowopenactiv>
<windowopenactiveendtime>0</windowopenactiveendtime>
<boostactive>0</boostactive>
<boostactiveendtime>0</boostactiveendtime>
<batterylow>0</batterylow>
<battery>70</battery>
<nextchange>
<endperiod>1661979600</endperiod>
<tchange>38</tchange>
</nextchange>
<summeractive>1</summeractive>
<holidayactive>0</holidayactive>
</hkr>
</device>
<device identifier="09995 0733974" id="17" functionbitmask="320" fwversion="05.02" manufacturer="AVM" productname="FRITZ!DECT 301">
<present>1</present>
<txbusy>0</txbusy>
<name>Zimmer 2</name>
<battery>70</battery>
<batterylow>0</batterylow>
<temperature>
<celsius>270</celsius>
<offset>0</offset>
</temperature>
<hkr>
<tist>54</tist>
<tsoll>253</tsoll>
<absenk>38</absenk>
<komfort>42</komfort>
<lock>1</lock>
<devicelock>0</devicelock>
<errorcode>0</errorcode>
<windowopenactiv>0</windowopenactiv>
<windowopenactiveendtime>0</windowopenactiveendtime>
<boostactive>0</boostactive>
<boostactiveendtime>0</boostactiveendtime>
<batterylow>0</batterylow>
<battery>70</battery>
<nextchange>
<endperiod>1661979600</endperiod>
<tchange>38</tchange>
</nextchange>
<summeractive>1</summeractive>
<holidayactive>0</holidayactive>
</hkr>
</device>
<device identifier="11630 0248598" id="18" functionbitmask="35712" fwversion="04.16" manufacturer="AVM" productname="FRITZ!DECT 200">
<present>1</present>
<txbusy>0</txbusy>
<name>K8s</name>
<switch>
<state>0</state>
<mode>manuell</mode>
<lock>0</lock>
<devicelock>0</devicelock>
</switch>
<simpleonoff>
<state>0</state>
</simpleonoff>
<powermeter>
<voltage>226873</voltage>
<power>0</power>
<energy>434</energy>
</powermeter>
<temperature>
<celsius>290</celsius>
<offset>0</offset>
</temperature>
</device>
<device identifier="11657 0271380" id="19" functionbitmask="35712" fwversion="04.17" manufacturer="AVM" productname="FRITZ!DECT 210">
<present>1</present>
<txbusy>0</txbusy>
<name>Schuppen</name>
<switch>
<state>0</state>
<mode>auto</mode>
<lock>0</lock>
<devicelock>0</devicelock>
</switch>
<simpleonoff>
<state>0</state>
</simpleonoff>
<powermeter>
<voltage>223379</voltage>
<power>0</power>
<energy>107357</energy>
</powermeter>
<temperature>
<celsius>245</celsius>
<offset>0</offset>
</temperature>
</device>
</devicelist> |
Hi, well, this is not really what I expected. But a simple google search brought this: https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AHA-HTTP-Interface.pdf Not sure If I'm willing to implement yet another Interface. |
I guess this is in popular demand. Let's see if we can implement this in the next few weeks. |
started implementing this. |
Hey @SebastianChudoba, @matthiasstock, @4920441, @donnerhund, I added the first version of support for homautomation values. Can you please checkout branch Thank you |
Hi Ricardo, |
The following should fix the diff --git a/fritzinfluxdb/classes/fritzbox/service_handler.py b/fritzinfluxdb/classes/fritzbox/service_handler.py
index a45d508..38644fd 100644
--- a/fritzinfluxdb/classes/fritzbox/service_handler.py
+++ b/fritzinfluxdb/classes/fritzbox/service_handler.py
@@ -154,7 +154,7 @@ class FritzBoxLuaService(FritzBoxService):
super().__init__(service_data)
- url_path = service_data.get("url_path")
+ url_path = service_data.get("url_path") or FritzBoxLuaURLPath.data
if url_path == FritzBoxLuaURLPath.data:
self.page = service_data.get("page") |
Thank you for testing. Will have a look why it is not working. |
My PR #50 fixes my requests, but leads to this error:
|
I have changed @matthiasstock's change "by hand" in the corresponding file. 2022-09-16 17:53:03,522 - ERROR: FritzBox Lua returned: 404 : Not Found |
damn, It's kinda difficult to write this stuff 'blind' without any actual real devices. But I will have a look tonight. I have an idea. I must have implemented the url_path incorrectly. if you run it with |
can you guys pull the latest thank you |
With another fix in PR #52, this branch works for me and writes home automation data to InfluxDB. |
I am going to start collecting data from the |
This is rendered from the fritzinfluxdata? Wow, nice 😬 |
During my test I got some error message when a DECT301 device temporary loses connection to FritzBox (could not find out why this sometimes happens so far). It seems that then some values are delivered back with "None" instead of 0:
|
Thank you for the testing. From I quick glace I didn't get the name and offset part. Will have a look later |
The implemented |
Ahh, this is not a problem. Will add this as well. |
Hi @schrdh, I just pushed a new version to Can you have a look if it behaves better now? thank you |
Thanks @bb-Ricardo, will check and give you feedback |
This seems to be mostly working with different versions of FritzOS. The "only" missing is the dashboard where I don't really know how to structure the data properly. |
Hey, just wanted to let you know that I have started working on a "Home Automation" dashboard. I haven't found any problems yet, just a typo: I think it should read It is written in Flux as I am having problems with InfluxQL in my setup. I'm ignoring a migration to InfluxQL for now. It will work out somehow... |
Thank you. Then I might have to convert all dashboards to Flux and be done with it. For Thank you so much. |
Just fixed the typo for |
Hi @ll, I consider this feature done. A dashboard (using Flux Query language) has been added: https://github.com/bb-Ricardo/fritzinfluxdb/blob/next-release/grafana/influx2_dashboards/fritzbox_home_automation_dashboard.json Highly appreciating test and validation. |
Works surprisingly well in a FreeBSD jail (TrueNAS 13) with pm2 as process manager. Ask away if somebody has questions regarding to it.
Question for the developer: Smart Home devices like FRITZ!DECT 200 can provide useful data such as temperature readings. Any way to get to that data through your python script?
The text was updated successfully, but these errors were encountered: