matthew-larner / inception-mqtt

A docker container to interface Inner Range Inception with MQTT to be used with home automation like Home Assistant
16 stars 10 forks source link

Discovery issue since inception panel timeout #11

Open jasonpstokes opened 1 year ago

jasonpstokes commented 1 year ago

Thanks for this project Matthew, it's been working great for months!

After updating HA to 2023.8.3 though, noticed the Inception Panel was not responding to inspection-mqtt with timeouts reported in the logs. A restart of the inception panel fixed this, but the devices in HA are still offline. Seems unlikely related, but any ideas or anything you can point me to, please?

The inception topic_prefix updates when opening doors etc as expected, so inception-mqtt container is working: image

But the only devices working in Home Assistant now are the three listed under the homeassistant topic_prefix - why only three? Or why isn't HA's autodiscovery reading the inception topic_prefix?

i.e. only warehouse still works, not office: image

And neither of these work in HA now: image

image

Is it possibly related to the MQTT Name changes in 2023.8 affecting discovery? Except I was running 2023.8.1 or .2 before the latest update. 🤷‍♂️

inception-mqtt configuration.yml

# MQTT Settings
mqtt:
  broker: mqtt
  port: 1883
  username: **
  password: **
  qos: 2
  retain: true
  discovery: true
  discovery_prefix: homeassistant
  topic_prefix: inception
  availability_topic: inception/available

# Inception area config
inception:
  - base_url: http://10.0.1.**/api/v1
    port: 80
    username: **
    password: **
    polling_timeout: 60
    polling_delay: 60

PS Sorry it's taken an issue to say thanks. :)

jasonpstokes commented 1 year ago

An update: went back to HA 2023.7, no change.

Removed MQTT from HA, deleted the inception and homeassistant topics from the MQTT database, then re-added MQTT in HA and started inception-mqtt - can see all the locks and sensors re-create under inception (as they trigger) but only have three items discovered in HA:

image

image

When first set it up everything was auto-discovered in HA and it's worked so well up until 3 days ago. Really stumped as to why this is not working now.

matthew-larner commented 9 months ago

Hey Jason,

Just so I can understand this correctly, are you saying that when you restart the inception controller, the integration stops working as expected in HA? Does restarting the container fix the issue?

If so, it may be that it doesn't auto-reconnect to the Inception REST API after the connection is terminated.

jasonpstokes commented 9 months ago

Hi Matt, Thanks for your reply. No, the issue was that the inception controller stopped responding (once), and restarting it fixed communication (for the add-on) - but then HA was no longer discovering the devices/entities that were back in MQTT.

Using MQTTExplorer I could/can see your addon pulling all the doors/locks/sensors/etc. from Inception into MQTT (as per last screenshot above), and the device states updating based on activity, but at the time at most only 3 devices would be discovered by HA (second last screen shot), and they wouldn't work in HA (wouldn't update state, could not control them).

Have you seen anything like this before?

I ended up creating all Inception/MQTT devices manually, and that's how it's been working since.

And it's working well ...except for the thousands of errors from the MQTT Alarm Panel state missing, even though retain is set to true???

mqtt:
  - alarm_control_panel:
    - unique_id: d06208e1-4d33-4f29-9b45-1ee74ff49f5e
      name: "Office"
      state_topic: "inception/alarm_control_panel/d06208e1-4d33-4f29-9b45-1ee74ff49f5e"
      command_topic: "inception/alarm_control_panel/d06208e1-4d33-4f29-9b45-1ee74ff49f5e/set"
      value_template: "{{ value_json.state }}"
      availability_topic: "inception/available"
      payload_arm_away: "arm"
      payload_disarm: "disarm"
      code_disarm_required: false
      code_arm_required: false
      retain: true
Logger: homeassistant.helpers.template
Source: helpers/template.py:751
First occurred: 18 December 2023 at 13:58:43 (36958 occurrences)
Last logged: 08:50:19

Error parsing value: 'value_json' is undefined (value: armed_away, template: {{ value_json.state }})
Error parsing value: 'value_json' is undefined (value: triggered, template: {{ value_json.state }})
Error parsing value: 'value_json' is undefined (value: disarmed, template: {{ value_json.state }})