Depending on when and how you installed Home Assistant, your Home Assistant username could either be hass or homeassistant. To confirm which username Home Assistant is using, type the following commands from the CLI:
Whichever one returns a result is most likely the account that Home Assistant is using. If neither one returns a result, try running getent passwd (which doesn’t filter any accounts). You’ll have to look through all the accounts and see if one looks like it would be the Home Assistant account.
Once you know which username Home Assistant is using, run sudo adduser <username> gpio, inserting the correct username. Reboot the RPI using sudo reboot and see if it works again.
Script wise, everything looks correct from what I can see. I’ve included a working copy of my config of the ZAP switches.
Thanks for your reply. It must have taken a while for the switch to load in HA for some reason. I went to sleep and it was there the next morning.
I have a question you might be able to answer though. I have 2 different brand fan/light ceiling fans with remotes. I can control the light and fan of the bedroom one but can’t control any of the livingroom one. I’ve tried adding/removing pulsestrength and protocol with no luck. I did notice that the living room codes are 8 digits long and all the examples I can find are either 6 or 7.
Do you think there could be a character limit to the code that the basic transmitter can output?
I’m assuming that your spacing is correct in your YAML files, as it looks like you have more than 2 spaces in your living room light section. I don’t know if there is a limitation on the code length or not, but just to rule out an error in the configuration, put the working code in the non-working section and vice-versa. Then see if the problem moves or not.
If the longer codes still don’t work, it’s possible that either there is a code limit of 7 characters, or that the 8-digit fixture may not be exactly in the 315/433 MHz range that the transmitter can send. If the unit has dip switches, try it with 3 different settings:
Dip switches all at 0
Dip switches all at 1
Dip switches at 0, but with every other one at 1
Keep in mind that the reciever’s range width (i.e. 314.750-315.750) may be wider than the transmitter’s range width (i.e. 314.900-315.650) which is why you can “see” the code, but can’t “send” the code. Changing the dip switches, if available, adjusts the exact frequency that is being sent/received on most units.
Spacing is correct, just transferred it to here incorrectly. No luck on the dip switches unfortunately. Thanks for trying to help though, I’ll reply if I come up with a solution.