Comfort Automation/ Security System Forums

Full Version: Comfort 2 Alarm working with Home Assistant!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
ok,
Forgive any innacuracies or errors, I am not really good at linux/coding etc, so this is how I stumbled accross it.
First off, my installation is  home assistant supervised, installed onto a rpi 3 using the standard install image.
The problem with this install, is I beleive that it is a \"containerised\" install, is heavily locked down, and does not have many of the linux applications etc installed to allow you run koochies install, so some modifications are required. Please feel free to expand on any of my poiints below (either by correction or explaining what is happening which would be helpful to those of us without the detailed understanding).
So, first off, what I think I am doing, is this. SSH into HA. I do this via an ssh add on, but not the normal one. The normal ssh add on takes you to the HA container, which is not suitable for this purpose (please forgive me if this is not the correct explanation, but it is what I think is the explanation).

I use an add on called \"advanced ssh and web terminal\"
Once installed (from the addon store) TURN OFF PROTECTION MODE and ENABLE SHOW IN SIDEBAR\"

Then start the addon.(it is slow to start)

the comfort2.py file koochie provided needs edited and be saved in the config folder. I do this, by enabling samba share and then using windows to connect to it like a network drive/folder, i edit the file with notepad then.
once comfort2.py is edited and installed, then in HA

Click on the TERMINAL

and use  koochys 2 commands:pip3 install paho-mqtt

Followed by:

python3 config/comfort2.py

you should then see the terminal startup and connect to comfort and report back.


The configuration.yaml file now needs to be updated, as the format is different from when koochie wrote his documentation. I am pasting my file below, which is/was done by trial and error, so it works. You need to do this to ensure the entities get created and mapped to the correctr comfort inputs etc. \"
# Loads default set of integrations. Do not remove.
 default_config:

# Load frontend themes from the themes folder
 frontend:
  themes: !include_dir_merge_named themes

# Text-to-speech
 tts:
  - platform: google_translate

 automation: !include automations.yaml
 script: !include scripts.yaml
 scene: !include scenes.yaml
# Example configuration.yaml entry

 mqtt:
  binary_sensor:
    - name: \"Front Door\"
      unique_id: \"front door\"
      state_topic: \"comfort2/input1\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Kitchen Door\"
      unique_id: \"Kitchen door\"
      state_topic: \"comfort2/input2\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Back Door\"
      unique_id: \"Back door\"
      state_topic: \"comfort2/input3\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Office Door\"
      unique_id: \"Office door\"
      state_topic: \"comfort2/input4\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Hall Motion\"
      unique_id: \"Hall Motion\"
      state_topic: \"comfort2/input5\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Corridoor Motion\"
      unique_id: \"Corridoor Motion\"
      state_topic: \"comfort2/input6\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Kitchen Motion\"
      unique_id: \"Kitchen Motion\"
      state_topic: \"comfort2/input7\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Den Motion\"
      unique_id: \"Den Motion\"
      state_topic: \"comfort2/input8\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Utility Motion\"
      unique_id: \"Utility Motion\"
      state_topic: \"comfort2/input9\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Office Motion\"
      unique_id: \"Office motion\"
      state_topic: \"comfort2/input10\"
      payload_on: \"1\"
      payload_off: \"0\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
    - name: \"Bathroom Motion\"
      unique_id: \"Bathroom Motion\"
      state_topic: \"comfort2/input11\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Ciaran Motion\"
      unique_id: \"Ciaran Motion\"
      state_topic: \"comfort2/input12\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Guest Motion\"
      unique_id: \"Guest Motion\"
      state_topic: \"comfort2/input13\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Master Bedroom Motion\"
      unique_id: \"Master Bedroom Motion\"
      state_topic: \"comfort2/input14\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"En Suite Motion\"
      unique_id: \"En Suite Motion\"
      state_topic: \"comfort2/input15\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"En Suite Door\"
      unique_id: \"En Suite Door\"
      state_topic: \"comfort2/input16\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Dressing Room Door\"
      unique_id: \"Dressing Room Door\"
      state_topic: \"comfort2/input17\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Kelly Motion\"
      unique_id: \"Kelly Motion\"
      state_topic: \"comfort2/input18\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"Living Room Motion\"
      unique_id: \"Living Room Motion\"
      state_topic: \"comfort2/input19\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
    - name: \"En Suite Door\"
      unique_id: \"En Suite door\"
      state_topic: \"comfort2/input24\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      payload_on: \"1\"
      payload_off: \"0\"
  alarm_control_panel:
    - name: \"Comfort Alarm\"
      unique_id: \"Comfort Alarm\"
      state_topic: \"comfort2/alarm\"
      command_topic: \"comfort2/alarm/set\"
      availability_topic: \"comfort2/alarm/online\"
      payload_available: \"1\"
      payload_not_available: \"0\"
      code: \"1234\"  #code can be different from Comfort\'s


that seems to work for me. The last bit is to get it to autostart, which I havent done yet, but will see if it works now in a while and post back.
I think the 2 key things here are with the standarad supervised install, you need to use an elevated version of ssh to get access to run the commands koochie has shown and the second point is the yaml file sytnax has changed to something like what I have posted above.




Looks good!!
Right, so I have decided to move the comfort2.py service over to a seperate RPI, so that HASS can run on its own and independently, and I can worry less about it being a non standard install.

I have (actually what I did was use a ucmp, wiped it and installed Raspberry OS lite on it, which is headless).

I installed paho-mqtt, worte the comfort2.py file etc, and got everyhitn working


I then followed the instructions to get it to autostart on reboot, and am falling down here.

So the comnfort2.py is installed in home/eamon/comfort2.py

Looking at the auto start command then, my file in systemd ( /etc/systemd/system/comfort2@pi.service) should be

\"[Unit]
Description=Comfort 2
After=network-online.target

[Service]
Type=simple
User=%i
ExecStart=/usr/bin/python3 /home/eamon/comfort2.py

[Install]
WantedBy=multi-user.target\"

Now, i can manually start comfort2.py and everyhting is ok, but it is not autostarting on a reboot ?

Anyone see what I am doing wrong here ?
I am also finding that the comfort2.py stops running the second I close the terminal to the machine. I tried the nohup command \"nohup python3 comfort2.py\" but that doest seem to do it!
Did you enable the autostart with \"systemctl enable comfort2\"?

Also, run dmesg after boot up to check for any errors.
Hello,

Just to let you know; i have created an addon for home assistant to have everything set up automatically.

You can add my addon repository to the addon store: https://github.com/posixx/hass_addons

addon name = Comfort 2 MQTT. You only have to configure ip, port and PIN.

Feel free to use!
Thanks Posixx.  Thats interesting!
Thats fantastic, thanks so much.
Can I ask a possible adaption/change might be looked at. I am getting comms failures on my comfort system which I do need to fix but having problems as its a house iwring issue I think. 
When the comms failure is reported, home assistant changes the state of the alarm to \"triggered\", is there any way to avoid this ?

I am looking into the integration of Comfort to MQTT/HA again and was wondering what you guys experience with arming from HA.
With the original script configuration from @koochy_rat, the arm command uses m! which is the \'Arm Local\' command. This requires you to press \'#\', or send \'KD1A\' to bypass any open zones.

The current script sends \'KD1A\' when it detects any open zones (\'ERxx\') but this messes up arming from a Comfort keypad. It \'presses\' the \'#\' key on your behalf so you don\'t hear all the open zone announcements.

Here is the question then: With HA\'s default Alarm Control Panel widget not having a \'#\' key, what do you guys use to arm and bypass open zones from HA? Also, do you use \'m!\' Local arm or \'M!\' Remote arm ?

Ingo
It would be useful to have a # key. Is that difficult to add?
That is a good question. We could maybe request a new feature addition from the developer.
Pages: 1 2 3 4 5 6 7 8 9