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

RETAIN flag #13

Closed 0raid closed 7 years ago

0raid commented 7 years ago

first congratulations for your amazing script! is working perfect! , i am trying to bridge with the home assistant component , and the instructions of the component it says it must be RETAIN flag the messages , can you please guide where to edit your code to the messages to be RETAIN flag?

also the instructions says:

The component will accept the following states from your Alarm Panel (in lower case):

‘disarmed’ ‘armed_home’ ‘armed_away’ ‘pending’ ‘triggered’

let me know how to edit also the mqtt message that publish with the above commands , so home assistant can regonize the messages.

thanks

george

Tertiush commented 7 years ago

Hi,

In the ParadoxIP150v2.py file the mqtt messages are published with the following line: client.publish(Topic_Publish_AppState, "Polling: Enabling...", 0, True)

The last flag which is set to True is the retain flag.

On line 469 is the code: client.publish(Topic_Publish_Events, reply, qos=0, retain=False) This is the line that sends events. Change the retain flag to True here. You will have to look at the ini file to change the topic and adjust the code accordingly to get to the outputs youre after. Good luck

Tertiush commented 7 years ago

post has been quiet for a while, closing it for now