Tertiush / ParadoxIP150v2

Python-based IP150 'middle-ware' that uses the IP module's software port for monitoring and control of the alarm via an MQTT Broker.
Eclipse Public License 1.0
73 stars 35 forks source link

Reading initial state, bugfix, small enchancements... #24

Closed 9a4gl closed 6 years ago

9a4gl commented 6 years ago

This should

  1. do initial state reading and publishing https://github.com/Tertiush/ParadoxIP150v2/issues/6
  2. fix publishing zone change with zone name containing space
  3. publish timestamp with some messages ...
Tertiush commented 6 years ago

Thanks for the PR!! I assume you have tested the code, I unfortunately won't have a chance anytime soon to do so, but am happy to merge if you haven't had any issues to date....?

9a4gl commented 6 years ago

I did, but with 5050 unit. Hope there will not be issues with other. In worst case if it cause issue revert it later :)

cybertza commented 6 years ago

The publish with timestamp should be an config.ini enable disable function. It is a breaking change for any integration that is looking for an zone to be "ON" is now receiving "ON 154831564"

Net result is

2018-02-18 21:50:35 WARNING (MainThread) [homeassistant.components.binary_sensor.mqtt] No matching payload found for entity: Passage with state_topic: Paradox/Zone/PASSAGE 2018-02-18 21:50:35 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: timestamp=1518983435.948583, level=WARNING, message=No matching payload found for entity: Passage with state_topic: Paradox/Zone/PASSAGE, exception=, source=components/binary_sensor/mqtt.py> 2018-02-18 21:50:38 WARNING (MainThread) [homeassistant.components.binary_sensor.mqtt] No matching payload found for entity: Passage with state_topic: Paradox/Zone/PASSAGE 2018-02-18 21:50:38 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: timestamp=1518983438.0033672, level=WARNING, message=No matching payload found for entity: Passage with state_topic: Paradox/Zone/PASSAGE, exception=, source=components/binary_sensor/mqtt.py>

Payload looks like this: 2/18/2018, 9:50:44 PMnode: 81aefd7.37b08 Paradox/Zone/PASSAGE : msg.payload : string[13] "ON 1518983435" 2/18/2018, 9:50:46 PMnode: 81aefd7.37b08 Paradox/Zone/PASSAGE : msg.payload : string[14] "OFF 1518983438"

9a4gl commented 6 years ago

I agree, can you fix it ? I will not be able to do that next few days.

psyciknz commented 6 years ago

I'm working on a fix for the timestamp, I think I've updated my fork with it, but I think I've just removed the publishwithtimestamp call with a straight publish.

I've also been working on trying to understand the SP protocol more, but hitting a brick wall, as I'm not getting the responses back that I expect to see.