koochyrat / comfort2

Cytech Comfort 2 Alarm MQTT Bridge (Home Assistant/OpenHAB compatible)
Apache License 2.0
6 stars 4 forks source link

mqtt Availability_topic for binary_sensor #1

Open auredor opened 5 years ago

auredor commented 5 years ago

Hello,

Thank you for your fantatsic work. It was quite pretty easy to integrate it in my home-assistant setup.

However, I do have an issue with the binary_sensor. If I want to get them working, I need to comment the availability_topic line from the binary_sensor section in the yalm file. I plan to check if this is not related to my current version of home-assistant but this "availability_topic" feature works properly for the other components used with mqtt (Alarm Control Panel, Sensor). So,it looks not related to HA version.

Also, could you please modify your comfort2.py code in order to manage non-consecutive VIRTUAL INPUTS. In my case, I've got two VI at Input 2 and 3 and the remaining from 9 to 16.

Thanks

auredor commented 5 years ago

Hello,

I've checked with the latest version of HA and I encounter the same issue. However, I noticed that I can get the availabilty_topic working fine if I stop the comfort2.serice and restart it after HA start :

pi@raspberrypi:~ $ sudo systemctl stop comfort2@pi.service pi@raspberrypi:~ $ sudo systemctl start comfort2@pi.service

So, we should probably manage the start sequence of this service in home-assistant@homeassistant.service

schford commented 5 years ago

It is easier just to use an automation to start the script after Home Assistant starts - it is what I do with my docker. First is line from config file then the automation....

shell_command: start_mqtt: 'python3 /config/python_scripts/comfort2a.py'

koochyrat commented 5 years ago

I have also noticed that the availability status does not change when comfort2 service is stopped. Will look into it.

As for the virtual inputs, there should be no problem if you just include the entire range (2,16) to cover non consecutive ranges. The overlapping does not affect Comfort.

auredor commented 5 years ago

@schford Thanks for the suggestion. I will do that. This give me more control on the start sequence.