Pilight Add-on

Has anyone gotten pilight working on Hass.io. I have found an add-on which is a pilight server which I assume you could then use with the pilight component but I haven’t been able to get this working. Has anyone had any experience setting this up? Thanks!

I’m in the same boat. I had it running on hassbian but with hass.io I’m at a loss what to do. Did you solve your problem?

I did but you would have to be willing to play around with docker containers and risk messing up your system. If your careful though, you will most likely be fine. See this reply I made on Github on how I got it working, https://github.com/pschmitt/hassio-addons/issues/25#issuecomment-491631671.

This is what I put in the configuration.yaml:

pilight:
  port: 5003

switch:
  - platform: pilight
    switches:
      heater:
        on_code:
          protocol: raw
          code: "867 502 408 510 400 498 410 501 866 502 404 508 405 499 865 499"
        off_code:
          protocol: raw
          code: "871 509 406 510 413 502 417 503 874 505 413 505 872 505"

And this is what I put in the Pilight config.json:

{
        "devices": {},
        "rules": {},
        "gui": {},
        "settings": {
                "port": 5003,
                "log-level": 6,
                "pid-file": "/var/run/pilight.pid",
                "log-file": "/var/log/pilight.log",
                "webserver-enable": 1,
                "webserver-root": "/usr/local/share/pilight/webgui",
                "webserver-http-port": 5001,
                "webserver-cache": 1,
                "gpio-platform": "raspberrypi3"
        },
        "hardware": {
                "433gpio": {
                        "sender": 0,
                        "receiver": 1
                }
        },
        "registry": {
                "pilight": {
                        "version": {
                                "current": "8.0.2"
                        }
                }
        }
}

I can now raw send codes just like I used to on Hassbian but without Hassbian’s issues! The only reason I was holding myself back from Hass.io, was because of pilight, but now that I have it working, I won’t go back.

1 Like

This is really helpful. Thank you!

I’m new to this whole thing with docker containers, but if I might ask before I try something that is doomed to fail. Would it be much more difficult to compile pilight in the container instead?

On hassbian I made the the changes for PULSE_LENGHT for the protocol that I’m using to lessen the load on the pilight daemon, but that required compiling it. Do you foresee any problems going that route instead?

I honestly have only just started using docker containers as well so I wouldn’t want to spread inaccurate information but I’m sure that if you can install the commands to compile it with apt-get you should be able to do what you want to do in the console of the container. As long as your messing around with your pilight container and not any other addons or Hass.io images or whatever I highly doubt anything would happen to the rest of the system. I mean that’s why it’s called a container :laughing: Just make sure that you save/commit your changes to a new image or the existing one straight after doing that because if you restart or stop it will revert back to the old version. Another option could be adding the commands for compiling in the Dockerfile then building the image again. Hopefully you can get this working. :smiley:

Even though this thread is quite old by now, I just wanted to add some info here.
I was also struggling with running a pilight daemon on my Raspberry Pi 3B+.
Therefore I created a Hassio Addon containing the Pilight Daemon. You can find it in my repo here: Hassio Addons.
Even though recompilation is not foreseen by now, this Addon is working fine for me with a 433MHz Transmitter attached to my Raspberry Pi.
I have not yet tested the receiver functionality, but I probably will in the future.

Feel free to use this addon and to give feedback on issues.

1 Like

Thank you so much ! I just received my transmitter, I plug it in, I install your addon, I configure as your addon documentation says, and … wonderful!

working on RPi4 4GB :+1:
(protocol: dio_switch)

well in fact, it works 5/6 commands, then nothing … and then reboot of the addon and it works 10 commands and nothing … :sweat_smile:

Maybe this is normal given the compatibility of the addon with the rpi4 … :cry:

edit:
as I am on a supervised installation, I directly installed pilight on Debian (without addons)

As I do not own a Raspberry Pi 4 myself, I did not have the possibility to check other platforms as well.
Nevertheless I enabled a debug print in the addon.
Maybe you could set the option “debug” in the configuration to true and then send me the log output of the addon itself in the “Logs” section.
Best would be after a fail of the addon.

And what do you mean by “directly on debian”?

Whenever I have time I will investigate and post the debug results.

Here (because i run Supervised)

How to configure config.json with your addon ?

I use this on pilight server :

{
        "devices": {},
        "rules": {},
        "gui": {},
        "settings": {
                "log-level": 6,
                "pid-file": "/var/run/pilight.pid",
                "log-file": "/var/log/pilight.log",
                "standalone": 1,
                "webserver-enable": 1,
                "webserver-root": "/usr/local/share/pilight/webgui",
                "webserver-http-port": 5001,
                "webserver-https-port": 5002,
                "webserver-cache": 1,
                "whitelist": "",
                "gpio-platform": "raspberrypi4",
                "port": 5010
        },
        "hardware": {
			"433gpio": {
				"sender": 0,
				"receiver": 1
			}
		},
        "registry": {
				"hardware": {
					"RF433": {
						"mingaplen": 4420,
						"maxgaplen": 72900,
						"minrawlen": 26,
						"maxrawlen": 400
					}
				},
                "webserver": {
                        "ssl": {
                                "certificate": {
                                        "location": "/etc/pilight/pilight.pem"
                                }
                        }
                },
                "pilight": {
                        "version": {
                                "current": "8.1.5"
                        }
                }
        }
}

I have to admit, that the json is not exactly editable in my addon.
I figured, it would only be necessary to adapt the gpio-platform and the hardware pins.

But I saw, that you forked my repository.
Have you been able to get it running, after modifying the config?

Maybe I could add some “raw config” fields to the config, where you could just wirte the json code to be inserted 1:1 into the config.

No, i forked for save the addon in my brain :shushing_face:

Does Pilight still work for you guys?

I managed to get Pilight working in RPI4 both directly on RaspberryPI OS and as a Docker container.

However, it does not seem to work on HassOS for me (I would like to migrate to HassOS and this is my last issue to solve).

I have opened an issue (#2271) a few months ago, but I haven’t got much help on that, so I’m a bit stuck. So, was wondering if anybody here has an idea of how to move forward.

Thanks in advance for any useful input on this.