Is it also possible to create a switch for a device āprofileā?
I have a internet profil for my kids phone that turns the wifi off in the night on weekdays - but want to leave it on if the weekday is a bank holiday (will be checked from a google calender) and other automations
This is awesome! I was thinking about creating such a component myself. But right now Iām still occupied with getting my HA installation into a basic working state.
Is it possible to install this component using the official HA docker image? I guess one could install it into the image. But if I understand it correctly the component would not survice a docker image upgrade, would it?
Currently not, but if itās something that the underlying python library provides, it could get added.
There are two ways to install it. Either use HACS (preferred way; also provides an easy way for upgrading it in the future) or drop it manually into your config folder: YOUR_CONFIG_DIRECTORY/custom_components/fritzbox_tools/.
Iām not running a docker environment myself, but I guess youāre mounting your config directory as a docker volume, so as long as your HA config stays when you rebuild the images, the component does as well
Thanks for the details. I havenāt looked into extending HA and wasnāt aware itās so easy. You are right, the config folder is usually persisted between reboots and after upgrades. Therefore it should be easy to just install it manually. As far as I understand it, hacs uses the same folder.
Just one more question. If I decide to install it manually, do I have to install the fritzconnection dependency manually into the docker container or will home assistant do it for me?
Iāve been using the old component since it came out. Had it on an old HA instance until last week but installed it on the latest hassio on Sunday and it still worked.
Did you manage to determine the current state of the guest wifi in the new version?
Iāve tested the latest version now and the switch / sensor for guest wifi work fine.
One thing that is irritating is that the switch turns back āoffā after activating because the fritzbox call apparently takes longer than HAās timeout / grace period. After a couple more seconds, it will be consistent again. Iām normally using a picture entity card to toggle the state so it will seemingly not react for 10s because it is not as optimistic as the switch control.
In case youāre looking for new features I have two suggestions:
Allow to create/delete or alternatively enable/disable port forwardings in the fritzbox. My use case, for example, is that I only turn on port forwarding on port 80 when I run the letsencrypt addon to refresh my SSL cert. So right now this is a manual step every ~90 days. Iāve looked into a shell script that was supposed to do that, but for some reason the fritzbox did not like the requestā¦
There is an API for that (AddPortMappingā, āDeletePortMappingā) but there was some issue with IPv6 being present recently even though only a IPv4 portmapping was requested.
Trigger phone calls
For my āalarm systemā I used to have a script that would trigger an outgoing call to my cell phone when the alarm would go off. So when I received a call from a dedicated number Iād know that Home assistant called. The script stopped working after a while unfortunatelyā¦ IIRC it used the āWƤhlhilfeā feature via ā/fon_num/dial_foncalls.luaā
Now that we can enable/disable the port forwarding for letsencrypt it would be possible to automatically trigger the hassio addon to renew the certificate.
One step is missing though: the new cert needs to be converted in the correct format and then uploaded to the fritzbox.
I did these things manually until I found this upload script:
It adds the different cert files along with some header infos into one temp file and then creates a post request to a certain endpoint.
In order to automate that weād need access to the hassio/ssl folder where the addon puts the cert files, though.
Is there a reason you terminate the SSL connection on the router?
Alternatives would be letting HA handle the ssl connection or using eg. nginx as a reverse proxy in front of your HA (there are hassio add-ons for this; thatās the way I do it).
I terminate SSL at the edge mainly because I expose the Fritz!Nas sometimes and by default the browsers show only security warnings due to the baked in default self-signed certificate.
Also, it has the benefit that other devices in the LAN do not have to deal with SSL at all.
I agree that it could be set up with Nginx Proxy manager (maybe), but I found that it is not as easy to setup as it sounds. I could not get many web apps to work properly through nginx proxy manager (I used the hassio addon). A simple & straight forward web app may work like described but when it comes to more complex ones like grafana, deconz, nextcloud and the like, it does not work out of the box.