I’ve created my first home assistant addon.
I got the idéa from a fellow community member Albertjvanr#6536, who wanted to be able to share a link to friends coming to visit.
Now his guests don’t have to call him to ask him to open the gate any more, they get a link with a one-time-use or time limited button which opens his gate instead.
I installed it and trying to use it. Created a sample light.toggle; do i need to give friends to use address: ‘192.168.1.30:8888/1d9fbd/’ assuming they logged in to my home wifi? Is port 8888 true??
UPDATE: When try to connect to this address i get a ‘Remote Control’ page with black background and no buttons whatsoever…
The first part of the address is what you entered into the external_url configuration value,
you can either port forward port 8888 in your router, or make use of a proxy in front of the addon.
The missing buttons is probably because of time limitation, if you choose that a button is visible
from today to today (default settings) it will never show as default time is 00:00:00 on both valid from and expires at
So you need to change time or date when the button expires (there’s already an issue to write some kind of more descriptive text instead of just showing up blank.
Thanks @TekniskSupport, that did it. 2 things maybe would be better:
As you mentioned, default action create gives today’s date however both time boxes come out as ‘–:--:–’. And that prevents the button to be visible. Maybe it would be better to also give default parameters for time as from 00:00:00 to 23:59:59. So that new users would be easier to adapt.
Both date and time parameters appear as USA format in my install; so like “09/10/2020 12:00 AM”. But i use European format (Germany maybe?) like “10.09.2020 23:59”. And all my settings are in European format like for OS and also Home Assistant. The only place i see USA format is in this addon. So, is there a way for me to change it?
My last humble comments;
maybe it would be better to write “Your friends should go to http://xxxx.xxx:8888/yyyyy to be able to use the button page” on the README on github page.
Is there a way to change the random page name to some more meaningful word? Like instead of “192.168.1.30:8888/1d9fbd/” i want to use “192.168.1.30:8888/(name of the friend)/”
Thanks to you, this addon will solve most of my problems…
The date and time parameters are not chosen by me, it is all rendered by your browser and should be according to your locales on the browser as far as i know (only thing i did was add <input type="date"> and <input type="time">)
@febalci I updated the code to account for 1.1 and 2.1.
The last comment (2.2) I added as an issue on github and will include in a future update,
I already have a few tasks created that has to do with link-data, check them out here (and don’t hesitate to create new issues over there if you have any more idéas):
It can be your hass-domain:8888 (if you didn’t change the port of the addon) or it could be your external ip, or another domain pointing at your ip or yeah you get the picture, it’s not important for the functionality of the addon anyhow.
If you don’t have a proxy in front, you may have to open port 8888 in your router or firewall
Ok so you are already running a reverse proxy for your homeassistant intance
and have a domain pointing at your ip, then
you can either, open port 8888 in your firewall/router and set external_url to http://myhomeassistant.com:8888/
Or prefered method, you can add a new reverse proxy to caddy with another domain (perhaps a subdomain?)
and set the external_url to https://subdomain.myhomeassistant.com/
running in the same issue. I have home assistant behind a proxy and don*t want to use port 8888 I will try to map this via proxy and will report
works perfectly by just proxy pass domain:8888 to domain.tld. We should maybe mention that the url of this app is not releated to the hass url. then it might be better understandable.
btw…great stuff!!! possible to design a bit the buttons and background to make it look nicer?
wow… i am that fascinated now that i would really like to make some ideas here:
Addind possibility to add custom header
adding possibility to add custom background color / piture / background
not really, the idéa is to create a link with mutiple actions, but you could if you wanted to copy the link off of a button which would be to an action
I will work on the button design, perhaps even add the ability to inject css
i think for 1, and 2, the best solution would be to make a theme with transparent background, that way you could make a wrapper with custom design and render the buttons in an iframe with custom background and so on