I have some led strips that I’ve connected to HA through Wemos D1-minis and mqtt.
Using tasker I set a profile for “Alarm Done” and then have a task that starts sending messages over mqtt to slowly increase the brightness of the leds. By the time snooze is over (6 mins) the lights have reached full brightness. If you get up before snooze fires there’s a tasker task to set the lights to max and then turn them off (to kill the prior task as it’s running in a loop).
My server setup is relatively complicated. Everything runs on one computer (host) all in separate docker containers. Including the ngix web server for the reverse proxy. The reverse proxy basically sends the web traffic to my different docker containers depending on the incoming DNS name.
Each docker container responds to is unique port from the same host IP. Docer forwards requests to the internal IP and port of the docker container. i.e.
Host IP is 192.168.178.58
Docker containers run in 172.17.0.x
Request to 192.168.178.58:1884 gets forwarded internally to 172.17.0.2:1883
Docker networking is effectively like setting up port forwarding on your home router.
My router is configured to forward port 443 to my inside computer (docker host) and then on to my ngix reverse proxy docker container
So to try and explain better from an outside my network point of view when you add the ngix reverse proxy:-
I have my own .com domain name. I use cloudflare to manage it (free). So I effectively have unlimited sub-domains.
In letsencypt you get a separate ssl certificate per sub domain.
I did hear somewhere that lets encrypt may be doing wildcard ssl certificates soon so in theory you could have one ssl certificate for all. But you will need your own domain name to do that.
I had issues where Tasker stops publishing mqtt messages without any errors. Now I am using httt post and script to publish mqtt mesagges and it seems that this works more reliably. Also, I do not need to rely on Tasker MQTT plugin which is relatively slower than http post. I am relatively new to home assistant and do not have python knowledge so I may wrong…
Hi - could you share more specifics about how you did the http post with Tasker? I am not having success with doing that. Can’t get the post to deliver json service data. Are you using shell scripts, or what exactly has worked for you? Thanks.
First I assume you have the ability to access home-assistant from outside your home network.
I use the Tasker HTTP Post action:-
In “Server:Port:”
https://home-assistant.wherever.com/api/states/sensor.myphone?api_password=mypassword
Whatever DNS…you really need dns…you have setup to point to your home IP.
Thank you for sharing all those specifics. It turns out that I am able to update a sensor, as you are doing, with Tasker HTTP post. And I am set up just that way, meaning that I have DNS and https. (And by the way, that is pretty cool!)
However when I try to pass data to a service with Tasker HTTP post, for example, by trying to pass properly formed json to /api/services/light/turn_off it always comes back with a 400 error. I have tried all different options for syntax, and none of them work. If I pass no service data at all to the service, then it will turn on all my lights, but I just can’t find a way to use the Tasker HTTP post to send data to a service.
People seem to be successful doing this same thing with curl, but for whatever reason home assistant doesn’t seem to like the way Tasker passes data to a service??
If you are able to succeed using Tasker to post to a service, and turn a light on or off, I would definitely be interested in finding out what the secret sauce is!
You may also check this:Ariela - Home Assistant Android Client
Its and android client for Home Assistant with build in device tracker (GPS or Wi-Fi or both), MQTT sensors, push notifications etc.