How to fix inverted status for sensors?
Alarm system
SP6000 connected via ESP32 to homeassistant
Environment
Linux, Homeassitant OS
Question
How to fix the inverted status for sensors?
I probably can create my own sensor on top of these MQTT sensor states to make it right, but just wanted to confirm if there is a better way to do this by fixing in the PAI config or in MQTT settings.
Motion Sensor: No motion states on MQTT "Detected" Detected motion "Cleared"
Door Sensor: Door Closed "Open" Door Open "Closed"
Logs (if required)
SP6000 Zone OFFICE Open detected motion 13:58:28 - 4 minutes ago SP6000 Zone OFFICE Open cleared (no motion detected) 13:58:28 - 4 minutes ago SP6000 System Date Time changed to 2024-03-08 13:58:00 13:58:26 - 4 minutes ago SP6000 Zone OFFICE Open detected motion 13:58:22 - 4 minutes ago SP6000 Zone OFFICE Open cleared (no motion detected) 13:58:22 - 4 minutes ago SP6000 Zone DOOR Open was opened 13:58:13 - 4 minutes ago SP6000 Zone DOOR Open was closed 13:58:12 - 4 minutes ago SP6000 Zone LIVING ROOM Open detected motion 13:57:33 - 4 minutes ago SP6000 Zone LIVING ROOM Open cleared (no motion detected) 13:57:33 - 4 minutes ago SP6000 Zone DOOR Tamper cleared tampering 13:57:26 - 5 minutes ago SP6000 System Date Time changed to 2024-03-08 13:57:00 13:57:26 - 5 minutes ago SP6000 Zone HALLWAY Open detected motion 13:57:24 - 5 minutes ago SP6000 Zone HALLWAY Open cleared (no motion detected) 13:57:24 - 5 minutes ago
Are you sure your door contacts are correctly wired?
Yes, the door contact and motion sensors are working fine with the alarm panel. The wiring was done by professional installers. I was just wondering maybe I need to change some config in homeassistant to fix this or it was a known issue?
I have already created custom binary sensors to fix this with the following:
-
platform: template sensors: living_room_motion_p: friendly_name: "Living Room Motion P" unique_id: living_room_motion_p device_class: motion value_template: "{{ 'off' if is_state('binary_sensor.sp6000_zone_living_room_open', 'on') else 'on' }}"
-
platform: template sensors: main_door_sensor_p: friendly_name: "Main Door Sensor P" unique_id: main_door_sensor_p device_class: door value_template: "{{ 'off' if is_state('binary_sensor.sp6000_zone_door_open', 'on') else 'on' }}"
Interesting if only you have these inverted. I have not received any complaints before.