mak-gitdev / HA_enoceanmqtt

Home Assistant wrapper for enocean-mqtt (https://github.com/embyt/enocean-mqtt)
GNU General Public License v3.0
54 stars 14 forks source link

Configuring of docker version #64

Closed LarsKoeppel closed 1 year ago

LarsKoeppel commented 1 year ago

I'm trying to use enoceanmqtt's docker image. Since some things don't work as expected, I tried to use logging and custom mappings. Is there a way to set the paths to these files in the config?

I have already tried the following:

mapping_file = /config/mapping.yaml
log_file        = /config/enoceanmqtt.log

The problem I'm trying to figure out is a misrepresented cover. Although it reports position 0, it is represented as closed in HA. Is this a problem of enoceanmqtt or of HA?

mak-gitdev commented 1 year ago

Hi @LarsKoeppel,

Regarding the docker configuration, I strongly recommend to have a look at the wiki. You just have to add your enoceanmqtt.conf file in your /config volume. Then in this file, supposing you have also a mapping.yaml file in the /config volume, add:

mapping_file = /config/mapping.yaml

For the log file, as explained in the wiki, run docker with this additional option:

--logfile /config/enoceanmqtt.log


Now regarding the problem, I think this is not an issue neither on my side nor on HA side.

This is well known and it happens from cover to cover. Some may report the correct position while others may report inverted position. I still don't have the final answer to this but my feeling is that some covers may have inverted cables, or may be a bad physical configuration of the EnOcean device. Changing the mapping.yaml to invert the reported position may correct the inverted covers but will certainly break the correct covers. I don't recommend to go this way. In my opinion, the best solution to date is to create a template cover on top of the ha_enoceanmqtt cover to invert the position.

I have some ideas to better deal with such cases at ha_enoceanmqtt level though.

mak-gitdev commented 1 year ago

Hi @LarsKoeppel,

Anything new ?

LarsKoeppel commented 1 year ago

Hi @mak-gitdev,

unfortunately I didn't had time to work on it this weekend. I'll get back to it in a few days.

To set the direction of a shutter, I could imagine a parameter in the config. Something like "reversed".

LarsKoeppel commented 1 year ago

Hi @mak-gitdev,

I managed to start the docker container with the appropriate options and write the log. Since I wanted to do this from the TrueNas Scale interface, it was a bit more cumbersome to achieve.

For everyone who is interested: Each part of the option must be entered individually for the "Container Args". (See image) image

But I still have problems with the template. I'm brand new to HA and don't really know much about it. So far I have copied this from the documentation. Could you possibly help me a bit? Especially when it comes to the control, I don't know what to do, because I have to use a virtual switch in enocean.

cover:
  - platform: template
    covers:
      rolladen:
        device_class: shutter
        friendly_name: "Rolladen"
        #value_template: "{{ is_state('sensor.rolladen', 'closed') }}"
        position_template: "{{ 100 - states('sensor.rolladen') }}"
        open_cover:
          service: script.open_rolladen
        close_cover:
          service: script.close_rolladen
        stop_cover:
          service: script.stop_rolladen

I would be very happy about any help.

mak-gitdev commented 1 year ago

Hi @LarsKoeppel,

As in the end, this is not an issue, I will convert it to a discussion. Let's continue there then