My Home Assistant setup uses nginx to proxy the web interface to HTTPS. I bought a Google Assistant for black friday and I want it to be able to control my lights... I haven't tested it yet but I figure I may as well start doing some setup!
The Home Assistant docs say that the emulated_hue component needs to run on port 80. This won't work by default because it doesn't have root permissions. I also didn't want to grant python the ability using cap_net_bind. My solution in the end was to create a NAT firewall rule on my server (see the end of this post). This takes anything that comes in via TCP on port 80 and redirects it to port 8300 (which is the port that Home Assistant was told to use for the emulated hue).
The issue with this is that nothing else that uses port 80 will work anymore - in particular nginx pages such as pi-hole. I figured I could just run pi-hole through HTTPS!
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8300
and for localhost redirects too (optional):
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8300
To remove these rules:
iptables -t nat --line-numbers -n -L
After several stability issues with my home automation controller I have decided to separate things across different devices. My latest (and...
For a project we are working on we invested in a ThorLabs KPA101 Position Aligner and a very sexy looking piezo actuated mirror mount as wel...
It seems like an obvious thing that's missing from the excellent Sonoff modules out there: an input for an external button (or two or fo...
Although Mikrotik do sell a nice metal case for their excellent RB433 RouterBoards, I have a RB435 because I need gigabit Ethernet and there...