• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. joe_at_home
    3. Posts
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by joe_at_home

    • RE: Home assistant integration

      @marko2276 ,
      After using your implementation for more than 2 years without flaw, both of my Unipi V1.1 systems (one with my whole Homeassistant installation) "died" from repeating powerfailures, due to grid loss and active but non functional emergency power. Both USB-sticks were damaged with backups on the same stick. Really bad luck, I should have known better.

      This forced me to a new installation using your altered code with unique_ids.
      Unfortunately, this code does not work properly having more than one Unipi-device with the same configuration(s).
      In this case the "unique_ids" will be identical for e.g. lights or switches on Unipi unit 1 and Unipi unit 2!
      Thus, Homeassistant isn't able to determine the targets anymore and will disable them.

      It took me some time effort to find this issue.

      As I'm using UniPi V1.1 devices, this migth only appear within my setup, but I'm pretty sure, this error will also occure on other unipi devices.

      I managed to get around this issue by extending the unique_id property definition(s) like this:

      code_text 
      @property
          def unique_id(self):
              """Return the unique ID of this light entity."""
              return f"{self._device}_{self._port}_at_{self._unipi_hub._name}"
      
      

      Hope, this will help others with the same issue.
      Cheers, Joerg

      posted in Installations
      J
      joe_at_home
    • RE: Home assistant integration

      Hi marko,
      thank you for your efford, creating this custom integration.

      I have two UniPi 1.1 boards (with RPI 4 - 2 GB version) to control my garden watering.

      With your integration, I_m now able to control both devices from HA, running in a docker container together with EVOK, not running in a container but installed on Pi-OS (buster) on one of these RPIs.
      The only flaw was the built in configuration validation, done by the regex check for the port value (in lights.py, line 36 vol.Required(CONF_PORT): cv.matches_regex(r"^[1-3]_[0-1][0-9]"),

      The port number scheme differs for UniPi 1.1 ("/relay/1") from Neuron ("/relay/1_01").

      I managed to add an regex alteration, thus both variants could be passed to Evok ,but only one will work, of course ("1" for UniPi or "1_01" for Neuron).

      vol.Required(CONF_PORT): cv.matches_regex(r"^[1-3]_[0-1][0-9]|[1-8]"),

      One might add some if else code depending on the so far unused type parameter ("L203", "M203", "S203" ) and addd "UniPi" to this list.
      But I'm not used to program with python, thus I'm happy with this little hack.

      Maybe one will find this useful, too.

      posted in Installations
      J
      joe_at_home