gpbenton / engMQTTClient

MQTT client for Energenie ener314-rt board running on a raspberry Pi
MIT License
21 stars 10 forks source link

Include a solution about how to run with new home assistant (HassOS) #28

Closed anthonyk91 closed 4 years ago

anthonyk91 commented 4 years ago

Home assistant is one of the main home integration systems, and they encourage the use of Home Assistant OS, which leaves less control over the operating system. The existing setup methods for engMQTTClient that I could find involve creating systemd services or similar, which are not possible in HassOS. Instead some kind of add-on with appropriate permissions may be an alternative.

I've been trying to get one working but haven't been able to get engMQTTClient to talk to the gpio board, it builds ok but when it runs there is no output from engMQTTClient, and no led output from the ener314-rt board. Its not so easy to debug when everything is running in a container with limited permissions. Below is an attempt at a config.json file for the add-on which has tried to open as much permissions as possible.

{
  "name": "Energenie MQTT",
  "version": "0.33",
  "slug": "energenie_mqtt",
  "description": "Energenie engMQTTClient",
  "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
  "startup": "before",
  "boot": "auto",
  "options": {
  },
  "schema": {
  },
  "gpio": "yes",
  "devices": ["/dev/mem:/dev/mem:rwm", "/dev/gpiomem:/dev/gpiomem:rwm"],
  "privileged": ["SYS_RAWIO", "SYS_RESOURCE", "SYS_ADMIN", "SYS_MODULE"],
  "host_network": "yes",
  "udev": "yes",
  "full_access": "yes",
  "apparmor": "no",
  "kernel_modules": "yes",
  "services": ["mqtt:need"]
}
gpbenton commented 4 years ago

You are probably better off asking someone in the HA community rather there.

I have no intention of learning proprietary operating systems, but I'll leave the ticket open in case someone else can help.

anthonyk91 commented 4 years ago

What other approaches have been used, for example installing HA "supervised" or "core" (https://community.home-assistant.io/t/on-hold-deprecating-home-assistant-supervised-on-generic-linux/194310 )? I got nudged into installing HassOS since that is how they show it is installed, and only realised later that it is not just a package over raspbian or something like that. I would prefer to have a standard self-managed OS as well, so I might check out the other install options.

gpbenton commented 4 years ago

I'm not sure what they call it these days, but I run Home Assistant as a python program installed using pip, just like any other python program. But I haven't upgraded in a few months - I'm still on 0.96.x

anthonyk91 commented 4 years ago

ok i've moved to using raspbian + pip install, seems like a better approach to me so i'm not going to take this any further