After many hours trying to find a way to control my 433mhz power plugs I finally found this one. I’m now able to control my lights with the command sudo piHomeEasy 0 31418 -1 on but i can´t get it to work with Home Assistant…
I can see the switches but nothing happens when i pull the trigger
Do i have to do anything more?
I run HA on a Raspberry Pi 3 and i have this code in configuration.yaml
I tried this but still nothing happens when I press the switch button… Can it be a permission problem? and if so how do i give HA the right permission?
You are getting there. The user that is running HA does not normally have sudo rights, so will not be able to run this command. But you need to say how you are running HA before we can say that this is actually the problem.
You can add homeassistant to the sudo users list. However, this has security implications if you have (or intend to) allow access to HA over the internet. If you never intend to this, then it is straightforward - as user pi do
sudo adduser homeassistant sudo
If you do plan to access HA from outside your network, you really shouldn’t do that, as if there is a failure in HA, it gives hackers a greater chance of access to your machine.
There is a way to restrict sudo access to certain commands, that someone suggested in the forums a while ago. I can’t find it right now, but it is worth searching for, as a way to limit the exposure.
I think that the way to investigate first is whether you can run your command without root access. You shouldn’t need root access to access the gpio. Try looking around where you got the program, to see if they have solutions.
Looking through our forums, the following might give you access tot the gpio as homeassistant user
sudo usermod -a -G gpio homeassistant
which might work for your program. You can then run it just as