lucacalcaterra / risco-mqtt-bridge

Risco Alarm panel to MQTT Server Bridge
MIT License
25 stars 9 forks source link

Risco Alarm Panel not working, but my scripts do. What's happening??? #30

Closed DrJohnT closed 4 years ago

DrJohnT commented 4 years ago

I have this in my configuration.yaml:

alarm_control_panel:
  - platform: mqtt
    name: Risco Alarm
    unique_id: !secret risco_alarm_id
    state_topic: "riscopanel/armstatus"
    command_topic: "riscopanel/armstatus/SET"
    payload_disarm: "disarmed" 
    payload_arm_home: "partially"
    payload_arm_night: "partially"
    payload_arm_away: "armed"

Which of course creates an entity:

alarm_control_panel.risco_alarm

However, when I look in the logbook, no activity is recorded for the alarm_control_panel.risco_alarm entity, even though there were times when the alarm was set. Also, if I add an Alarm Panel to my Lovelace UI, it does not work at all.

Because the above was not working I created a sensor and a binary_sensor which use MQTT messages directly as follows:

In sensors.yaml

- platform: mqtt
  unique_id: risco_alarm_status
  state_topic: "riscopanel/armstatus"
  name: Alarm Status
  icon: mdi:bell

And in binary_sensor.yaml

- platform: template
  sensors:
    ###################### Risco Alarm Armed ######################
    risco_alarm_armed:
      friendly_name: 'Alarm'
      value_template: >-
        {{ is_state('sensor.alarm_status', 'armed') 
          or is_state('sensor.alarm_status', 'partarmed') 
        }}      
      icon_template: >-
        {% if is_state('binary_sensor.risco_alarm_armed', 'on') %}
          mdi:bell-check
        {% else %}
          mdi:bell-off-outline
        {% endif %}

In an attempt to replace the Alarm Panel in Lovelace, I created a switch in switches.yaml

- platform: mqtt
  name: "Risco Alarm"
  command_topic: "riscopanel/armstatus/SET"
  payload_on: "armed"
  payload_off: "disarmed"
  state_topic: "riscopanel/armstatus"
  state_on: "armed"
  state_off: "disarmed"
  optimistic: false

This works, although there is a delay in setting the state to On / Armed.

The question is, why does the alarm_control_panel.risco_alarm config fail to work when my switch does?? Any help would be appreciated.

pergolafabio commented 4 years ago

what is that uniqie id? i dont have it

here is mine...

ps: the delay for arming / disarming is normal if you arm/disarm trough a hardware panel... if you test with the app, then its almost instant

alarm_control_panel:
 - platform: mqtt
   name: Risco Alarm
   state_topic: "riscopanel/armstatus"
   command_topic: "riscopanel/armstatus/SET"
   payload_disarm: "disarmed" 
   payload_arm_home: "partially"
   payload_arm_away: "armed"
   code_arm_required: false
DrJohnT commented 4 years ago

Removing the unique_id and adding

  code_arm_required: false

simply created a second Risco alarm entity which still did not work. The second Risco alarm entity still reported that the Risco alarm was disarmed when it was armed and my sensor reported armed too.

I found the unique_id on the https://www.home-assistant.io/integrations/alarm_control_panel.mqtt/ unique_id (string)(Optional) An ID that uniquely identifies this alarm panel. Which is why I added it. With or without this unique_id the panel does not work. All a bit odd.

Also, if I change

  code_arm_required: true

The alarm control panel does not request a code.

All a bit confusing!

lucacalcaterra commented 4 years ago

inactivity

DrJohnT commented 4 years ago

Hey Luca, integration has been working well for a while, hence no update. I had made a mistake in the config file. Did a rebuild of my Pi4 recently. Used portainer to install the docker image and bingo, all working again without a hitch. I love docker!

lucacalcaterra commented 4 years ago

Hey Luca, integration has been working well for a while, hence no update. I had made a mistake in the config file. Did a rebuild of my Pi4 recently. Used portainer to install the docker image and bingo, all working again without a hitch. I love docker!

so can close it ?

DrJohnT commented 4 years ago

Of course