Posted: Saturday Jun 17th, 2023 01:03 pm |
|
61st Post |
wexfordman
UCM Pi Users
Joined: | Monday Jan 1st, 2007 |
Location: | Cork, Ireland |
Posts: | 546 |
Status: |
Offline
|
back to top
|
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.
Last edited on Saturday Jun 17th, 2023 01:23 pm by wexfordman
|
Posted: Saturday Jun 17th, 2023 03:31 pm |
|
62nd Post |
Posted: Sunday Jun 18th, 2023 07:05 pm |
|
63rd Post |
wexfordman
UCM Pi Users
Joined: | Monday Jan 1st, 2007 |
Location: | Cork, Ireland |
Posts: | 546 |
Status: |
Offline
|
back to top
|
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!
Last edited on Sunday Jun 18th, 2023 07:51 pm by wexfordman
|
Posted: Thursday Jun 22nd, 2023 09:50 am |
|
64th Post |
Sota
UCM Pi Users
Joined: | Friday May 3rd, 2013 |
Location: | Galway, Ireland |
Posts: | 84 |
Status: |
Offline
|
back to top
|
Did you enable the autostart with "systemctl enable comfort2"?
Also, run dmesg after boot up to check for any errors.
|
Posted: Sunday Aug 13th, 2023 01:02 pm |
|
65th Post |
posixx
Member
Joined: | Saturday Jul 8th, 2006 |
Location: | |
Posts: | 24 |
Status: |
Offline
|
back to top
|
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!
|
Posted: Monday Aug 14th, 2023 01:57 am |
|
66th Post |
slychiu
Administrator
Joined: | Saturday Apr 29th, 2006 |
Location: | Singapore |
Posts: | 5570 |
Status: |
Offline
|
back to top
|
Thanks Posixx. Thats interesting!
|
Posted: Monday Sep 4th, 2023 01:37 pm |
|
67th Post |
wexfordman
UCM Pi Users
Joined: | Monday Jan 1st, 2007 |
Location: | Cork, Ireland |
Posts: | 546 |
Status: |
Offline
|
back to top
|
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 ?
|
Posted: Friday Apr 12th, 2024 11:51 am |
|
68th Post |
Ingo
UCM Pi Users
Joined: | Sunday Jan 21st, 2007 |
Location: | South Africa |
Posts: | 573 |
Status: |
Offline
|
back to top
|
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 ?
IngoLast edited on Friday Apr 12th, 2024 11:51 am by Ingo
|
Posted: Friday Apr 12th, 2024 12:31 pm |
|
69th Post |
slychiu
Administrator
Joined: | Saturday Apr 29th, 2006 |
Location: | Singapore |
Posts: | 5570 |
Status: |
Offline
|
back to top
|
It would be useful to have a # key. Is that difficult to add?
|
Posted: Friday Apr 12th, 2024 03:03 pm |
|
70th Post |
Ingo
UCM Pi Users
Joined: | Sunday Jan 21st, 2007 |
Location: | South Africa |
Posts: | 573 |
Status: |
Offline
|
back to top
|
That is a good question. We could maybe request a new feature addition from the developer.
|
Posted: Thursday Apr 18th, 2024 09:56 am |
|
71st Post |
Sota
UCM Pi Users
Joined: | Friday May 3rd, 2013 |
Location: | Galway, Ireland |
Posts: | 84 |
Status: |
Offline
|
back to top
|
I'm not able to test this as my house is being renovated, but perhaps you could use the Custom Bypass button in your MQTT Alarm Control panel to send # like this:
payload_arm_away: 'away'
payload_arm_home: 'day'
payload_arm_night: 'night'
payload_arm_vacation: 'vacation'
payload_disarm: 'off'
payload_arm_custom_bypass: '#'
|
Posted: Thursday Apr 18th, 2024 10:55 am |
|
72nd Post |
Ingo
UCM Pi Users
Joined: | Sunday Jan 21st, 2007 |
Location: | South Africa |
Posts: | 573 |
Status: |
Offline
|
back to top
|
I will give it a try, thanks.
Edit: I've tried this and it works. The only drawbacks are that the virtual keypad text obviously doesn't reflect the function '#' and you need to enter your code when 'arming' to CUSTOM_BYPASS. A minor hassle for this workaround.
Apart from that it works like a charm. Now you can do Local Arm without a hitch.Last edited on Thursday Apr 18th, 2024 02:19 pm by Ingo
|
Posted: Friday Apr 19th, 2024 01:08 pm |
|
73rd Post |
Ingo
UCM Pi Users
Joined: | Sunday Jan 21st, 2007 |
Location: | South Africa |
Posts: | 573 |
Status: |
Offline
|
back to top
|
I found the following in the config options.
code_arm_required: false
I don't know how I missed this but now arming to any mode does not require a pin code. It's only required for Disarm. The 'virtual # key' now works fine.Last edited on Friday Apr 19th, 2024 01:09 pm by Ingo
|
Posted: Friday Apr 19th, 2024 01:15 pm |
|
74th Post |
Sota
UCM Pi Users
Joined: | Friday May 3rd, 2013 |
Location: | Galway, Ireland |
Posts: | 84 |
Status: |
Offline
|
back to top
|
FYI, this is my alarm config. I use the REMOTE_CODE option to avoid having to save the disarm code in the config. Also allows for different users to log in:
###### Alarm Control Panels ####### https://www.home-assistant.io/integrations/alarm_control_panel.mqtt/
- name: 'Comfort Alarm'
unique_id: comfort_alarm_panel_1
state_topic: 'homeassistant/alarm/comfort/alarm_mode/status'
command_topic: 'homeassistant/alarm/comfort/alarm_mode/set'
code_arm_required: false
code_disarm_required: true
payload_arm_away: 'away'
payload_arm_home: 'day'
payload_arm_night: 'night'
payload_arm_vacation: 'vacation'
payload_disarm: 'off'
payload_arm_custom_bypass: '#'
code: REMOTE_CODE
command_template: >
{ "action": "{{ action }}", "code": "{{ code }}" }
Last edited on Friday Apr 19th, 2024 01:19 pm by Sota
|
Posted: Friday Apr 19th, 2024 02:28 pm |
|
75th Post |
Ingo
UCM Pi Users
Joined: | Sunday Jan 21st, 2007 |
Location: | South Africa |
Posts: | 573 |
Status: |
Offline
|
back to top
|
Interesting! I will have to read up on that command_template of yours.
|
Current time is 04:39 pm | Page: 1 2 3 4 |
|