MnrGreg / homebridge-paradox-security-system

Homebridge iOS HomeKit Accessory plugin to control your Paradox Alarm System
Apache License 2.0
20 stars 9 forks source link

Home Assistant Integration #7

Open cybertza opened 7 years ago

cybertza commented 7 years ago

So I've made the following strides integrating with Home Assistant,

1) I parse the data from the MQTT stream and the split them to topics for the zones, i then mark them, and give them states. I then bring them in into the HomeKit Bridge MQTT topic. I am almost done with the complete whole thing. (its very crude and can work a lot better)(i do it all in node red)

I will paste my node red code when i'm done and then we can maybe colab to get it further, as if i spent more time with node red i can pull this off by using the raw data from the MQTT stream instead of the Dictionary values.

IE E0:SE6 instead of splitting and parsing my names Event:Zone open;SubEvent:GARAGE BEAM

Obviously the danger is rather evident with this, in many ways. and at the moment im using a split that detects Regxp :> zone numbers.

I then bring them into the MQTT Topic as Zones, Ive then added the Zones As MQTT Binary inputs. to allow me to use the inputs, and i have played a bit with the garadge door input and a pgm to drive the motor,

I then bound all of this across with the homebridge <> Home Assistant plugin. This then creates all the zones i made to Ocupancy Sensors, usable for ligting and so forth iside home in IOS.

what needs work: 1 Use Data Stream (event_payload_numeric =1) in PAradoxIP150V2) 2 Rename Topics in Homebrdige-Paradox to correct Machine Talk (request pull with instructions) 3 Script the Node red Split to work with the Zone's instead of the Zone Definitions. (i can do this myself the long way, need to research to do it as a function) 4 Fix the Sleep Topic and the actual IOS alarm = correct alarm state (pull request)

Need to show: 1) instruciton for Ip150 = numeric 2) Instruction homebrige config edit 3) instruction funcion for node red to parse data from "localhost mqtt IP150 topics => HomeBridge MQTT Alarm topics" 4) finished edit on state files for homebridge

Result All detectors can show as motion sensors inside IOS HOME. IOS Home Understands Event_numerics (the arm and disarm commands remain the same.)

if you want me to do a for with pull requests for the machine talk ver i am happy to colab, issue goes forward, since there is no way to easily decode sensor value from the mqtt sream it may be better to have the mqtt stream updated from the developer side to include number? Event:Zone open;SubEvent:GARAGE BEAM + Event:State open;Zone=01;SubEvent:GARAGE BEAM

Let me know what you think?

cybertza commented 7 years ago

The node red coded ended up being extremely Proprietary due to the fact that i need to parse each zone name via a split argument, and then after that split them again for open/restore, and then sent it to home assist, if there is a need for it, i don't mind sharing it.

cybertza commented 7 years ago

[{"id":"8617f1a2.afaa7","type":"subflow","name":"Zone Status","info":"","in":[{"x":160,"y":120,"wires":[{"id":"50d07ea1.60c03"}]}],"out":[{"x":600,"y":120,"wires":[{"id":"3fe551d0.f19bde","port":0},{"id":"c2735712.aac898","port":0}]}]},{"id":"3fe551d0.f19bde","type":"change","z":"8617f1a2.afaa7","name":"Set 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":100,"wires":[[]]},{"id":"c2735712.aac898","type":"change","z":"8617f1a2.afaa7","name":"Set 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":140,"wires":[[]]},{"id":"50d07ea1.60c03","type":"switch","z":"8617f1a2.afaa7","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"Zone open","vt":"str","case":true},{"t":"regex","v":"Zone OK","vt":"str","case":true}],"checkall":"true","outputs":2,"x":310,"y":120,"wires":[["3fe551d0.f19bde"],["c2735712.aac898"]]},{"id":"241a68de.5be0f8","type":"tab","label":"Paradox Stuff"},{"id":"1a09ab6e.b2cd25","type":"comment","z":"241a68de.5be0f8","name":"Idea is here to stage the actual data best possible way for use with HomeAssistant :: https://github.com/Tertiush/ParadoxIP150v2","info":"","x":819.5,"y":86.25,"wires":[]},{"id":"aca2938d.6064c","type":"comment","z":"241a68de.5be0f8","name":"What we get on Paradox/Events: Event:Zone open;SubEvent:PASSAGE","info":"Event:Zone OK;SubEvent:PASSAGE","x":350,"y":179,"wires":[]},{"id":"8f2b1946.8c6968","type":"comment","z":"241a68de.5be0f8","name":"What we we can use /alarm/zone1/status[bin]","info":"Event:Zone OK;SubEvent:PASSAGE","x":1103.75,"y":160,"wires":[]},{"id":"aaebdff5.e11","type":"comment","z":"241a68de.5be0f8","name":"Inbound Data","info":"","x":780.5,"y":120.25001525878906,"wires":[]},{"id":"af56d3bd.9c82","type":"comment","z":"241a68de.5be0f8","name":"Outbound Data","info":"","x":840,"y":1880,"wires":[]},{"id":"49e80af0.0644b4","type":"comment","z":"241a68de.5be0f8","name":"control alarm","info":"Publish the following topic to control the alarm:\nParadox/C/P1/Disarm\n(C = Control; P = Partition, followed by number; Then the action = Disarm / Arm / Sleep / Stay)\nThe payload is not evaluated in this case. Note that alarm controls can take a few seconds as the script must first be re-authenticated\nParadox/C/P1, Payload: Disarm\nIn this case the payload is used to determine the command to send.\n\n","x":217.6364631652832,"y":1964.3642463684082,"wires":[]},{"id":"e5e42f35.55802","type":"comment","z":"241a68de.5be0f8","name":"PGM","info":"Publish the following topic to control (Force/Pulse) an output (PGM):\nParadox/C/FO/4/Off\n(C = Control; FO = Force output / PO = Pulse Output, followed by the output number; Then the action (for pulse this will be the intermediate state, e.g. to pulse High then back to Low use \"On\" and vice versa).\nThe payload is not evaluated in this case. Note that output controls can take a few seconds as the script must first be re-authenticated\nPulse outputs are configured for approx. 0.5sec.\nParadox/C/PO/1, Payload: On\nIn this case the payload is used to determine the command to send: Pulse Output 1, On->Off","x":207.81830215454102,"y":2011.6371536254883,"wires":[]},{"id":"85f42b7c.7c2c48","type":"mqtt in","z":"241a68de.5be0f8","name":"Paradox/Events","topic":"Paradox/Events","qos":"2","broker":"d2514633.e1de68","x":184,"y":267,"wires":[["3ba077c7.d71a78","a3554553.bfaa98"]]},{"id":"9eff5960.67ced8","type":"mqtt out","z":"241a68de.5be0f8","name":"","topic":"Paradox/C/PO/6","qos":"","retain":"","broker":"d2514633.e1de68","x":1160.5455703735352,"y":2611.8182315826416,"wires":[]},{"id":"285edc92.b09ac4","type":"mqtt out","z":"241a68de.5be0f8","name":"","topic":"Paradox/C/Polling/Disable","qos":"","retain":"","broker":"daa2c6d4.8bfd88","x":1160.545555114746,"y":2413.818290710449,"wires":[]},{"id":"8abde030.44c74","type":"inject","z":"241a68de.5be0f8","name":"","topic":"Enable","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":930.5455551147461,"y":2483.818290710449,"wires":[["473274b5.2ef04c"]]},{"id":"5d259233.77a14c","type":"inject","z":"241a68de.5be0f8","name":"","topic":"Disable","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":921.5455551147461,"y":2414.818290710449,"wires":[["285edc92.b09ac4"]]},{"id":"473274b5.2ef04c","type":"mqtt out","z":"241a68de.5be0f8","name":"","topic":"Paradox/C/Polling/Enable","qos":"0","retain":"","broker":"daa2c6d4.8bfd88","x":1156.545555114746,"y":2482.818290710449,"wires":[]},{"id":"54506280.d861bc","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"On","payloadType":"str","repeat":"","crontab":"","once":false,"x":917.5455703735352,"y":2611.8182315826416,"wires":[["9eff5960.67ced8"]]},{"id":"fb30bd52.88aeb","type":"mqtt in","z":"241a68de.5be0f8","name":"home/alarm/set","topic":"home/alarm/set","qos":"2","broker":"d2514633.e1de68","x":116.90931701660156,"y":1906.8187742233276,"wires":[["872f55b0.75be08"]]},{"id":"872f55b0.75be08","type":"debug","z":"241a68de.5be0f8","name":"","active":true,"console":"false","complete":"false","x":283.0911445617676,"y":1906.5459995269775,"wires":[]},{"id":"10fd9795.240c88","type":"mqtt out","z":"241a68de.5be0f8","name":"21 jaco","topic":"home/alarm/zone21/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1280,"y":640,"wires":[]},{"id":"f0b75fb7.13d0f","type":"comment","z":"241a68de.5be0f8","name":"test working","info":"","x":373.75,"y":551.25,"wires":[]},{"id":"835ea615.204588","type":"mqtt out","z":"241a68de.5be0f8","name":"","topic":"home/alarm","qos":"","retain":"true","broker":"d2514633.e1de68","x":1650,"y":1440,"wires":[]},{"id":"11d291d2.1a0b2e","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"x":909.2726211547852,"y":1364.3636722564697,"wires":[["c2f83dcf.538df"]]},{"id":"fc30b229.37fd8","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"x":890.4544525146484,"y":1466.2728443145752,"wires":[["de2eb2b6.25506"]]},{"id":"7b3c4ec5.5f7c","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"x":890.2726402282715,"y":1515.3636770248413,"wires":[["a1fe9303.6629c"]]},{"id":"90ea23de.5694a","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"3","payloadType":"str","repeat":"","crontab":"","once":false,"x":920.2726402282715,"y":1572.3636770248413,"wires":[["ce1caa6f.912748"]]},{"id":"6cb4af14.ba18b","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"4","payloadType":"str","repeat":"","crontab":"","once":false,"x":915.2726402282715,"y":1619.3636770248413,"wires":[["396bd63b.8375da"]]},{"id":"b0ef8be1.8a4bf8","type":"mqtt out","z":"241a68de.5be0f8","name":"27 gate","topic":"home/alarm/zone27/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1280,"y":680,"wires":[]},{"id":"8c392700.877398","type":"mqtt out","z":"241a68de.5be0f8","name":"20 erin","topic":"home/alarm/zone20/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1280,"y":600,"wires":[]},{"id":"ca9bcc66.f23c6","type":"mqtt out","z":"241a68de.5be0f8","name":"1 garage and front","topic":"home/alarm/zone1/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1310,"y":200,"wires":[]},{"id":"3dcbe38e.579f5c","type":"mqtt out","z":"241a68de.5be0f8","name":"2 Study","topic":"home/alarm/zone2/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1280,"y":240,"wires":[]},{"id":"be2eb8e8.e729b8","type":"mqtt out","z":"241a68de.5be0f8","name":"3 tv","topic":"home/alarm/zone3/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1270,"y":280,"wires":[]},{"id":"e778bb35.b608e8","type":"mqtt out","z":"241a68de.5be0f8","name":"5 keyswitch","topic":"home/alarm/zone5/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1290,"y":320,"wires":[]},{"id":"4ae95ce4.b64d34","type":"mqtt out","z":"241a68de.5be0f8","name":"6 passage","topic":"home/alarm/zone6/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1290,"y":360,"wires":[]},{"id":"aa9e5033.5dffb","type":"mqtt out","z":"241a68de.5be0f8","name":"7 kitchen door","topic":"home/alarm/zone7/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1300,"y":400,"wires":[]},{"id":"4119b44e.ffd8ec","type":"mqtt out","z":"241a68de.5be0f8","name":"8 main bedroom","topic":"home/alarm/zone8/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1310,"y":440,"wires":[]},{"id":"f079571b.5fe2e8","type":"mqtt out","z":"241a68de.5be0f8","name":"9 kids room","topic":"home/alarm/zone9/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1290,"y":480,"wires":[]},{"id":"57efe0e1.45d5e","type":"inject","z":"241a68de.5be0f8","name":"Event:Zone open;SubEvent:GARAGE BEAM","topic":"","payload":"Event:Zone open;SubEvent:GARAGE BEAM","payloadType":"str","repeat":"","crontab":"","once":false,"x":390,"y":600,"wires":[["a3554553.bfaa98"]]},{"id":"ba8484d3.2a90d8","type":"inject","z":"241a68de.5be0f8","name":"Event:Zone OK;SubEvent:GARAGE BEAM","topic":"","payload":"Event:Zone OK;SubEvent:GARAGE BEAM","payloadType":"str","repeat":"","crontab":"","once":false,"x":380,"y":640,"wires":[["a3554553.bfaa98"]]},{"id":"3ba077c7.d71a78","type":"debug","z":"241a68de.5be0f8","name":"","active":true,"console":"false","complete":"false","x":376.25,"y":266.25,"wires":[]},{"id":"a3554553.bfaa98","type":"switch","z":"241a68de.5be0f8","name":"splitter","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"FRONT","vt":"str","case":false},{"t":"regex","v":"STUDY","vt":"str","case":false},{"t":"regex","v":"TV ROOM","vt":"str","case":false},{"t":"btwn","v":"0","vt":"num","v2":"1","v2t":"num"},{"t":"regex","v":"Keyswitch","vt":"str","case":false},{"t":"regex","v":"PASSAGE","vt":"str","case":false},{"t":"cont","v":"KITCHEN DOOR","vt":"str"},{"t":"cont","v":"MAIN BEDROOM","vt":"str"},{"t":"cont","v":"FIRST KIDS RM","vt":"str"},{"t":"cont","v":"LOUNGE","vt":"str"},{"t":"cont","v":"SWEMBAD","vt":"str"},{"t":"eq","v":"4536456","vt":"str"},{"t":"eq","v":"34563456","vt":"str"},{"t":"eq","v":"3547634577534","vt":"str"},{"t":"eq","v":"7354753735","vt":"str"},{"t":"eq","v":"234524624","vt":"str"},{"t":"eq","v":"23452345","vt":"str"},{"t":"eq","v":"23452345","vt":"str"},{"t":"eq","v":"23452345","vt":"str"},{"t":"cont","v":"Erin Garage","vt":"str"},{"t":"cont","v":"Jaco Garage","vt":"str"},{"t":"eq","v":"23455","vt":"str"},{"t":"eq","v":"23456","vt":"str"},{"t":"eq","v":"23457","vt":"str"},{"t":"eq","v":"2236","vt":"str"},{"t":"eq","v":"35345","vt":"str"},{"t":"cont","v":"MAINGATE","vt":"str"},{"t":"cont","v":"PATIO BEAM","vt":"str"},{"t":"cont","v":"KITCHEN BEAM","vt":"str"},{"t":"cont","v":"BEDROOM BEAM","vt":"str"},{"t":"cont","v":"SPAREROOM BEAM","vt":"str"},{"t":"cont","v":"GARAGE BEAM","vt":"str"},{"t":"cont","v":"Any zone","vt":"str"},{"t":"else"}],"checkall":"false","outputs":34,"x":750,"y":640,"wires":[["2175e1f6.5268ce"],["848bd75e.373b08"],["6f181717.bff478"],[],["5d315f2.a6819a"],["a2ab1bd1.79ced8"],["3e5359d5.99f586"],["de6030e0.cfc6c"],["4b1ff86d.07a2e8"],["2a7620f.1e062e"],["2cb2947e.97f7ac"],[],[],[],[],[],[],[],[],["9c3668d5.880168"],["2bdc3663.416fda"],[],[],[],[],[],["c1ef1fa.eec3be"],["5ce16795.768af8"],["8d82ee76.8cb49"],["307ba803.00edd8"],["64aea33f.43050c"],["7f939128.c584c"],["772a1e5.898b6e"],["9854661e.a4f338"]]},{"id":"c531fa62.9025c8","type":"mqtt out","z":"241a68de.5be0f8","name":"10 lounge","topic":"home/alarm/zone10/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1280,"y":520,"wires":[]},{"id":"d617c791.aff008","type":"mqtt out","z":"241a68de.5be0f8","name":"11 pool","topic":"home/alarm/zone11/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1280,"y":560,"wires":[]},{"id":"c51f79b.4032b88","type":"mqtt out","z":"241a68de.5be0f8","name":"28 patio b","topic":"home/alarm/zone28/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1280,"y":720,"wires":[]},{"id":"2487ac5d.292504","type":"mqtt out","z":"241a68de.5be0f8","name":"29 kitchen b","topic":"home/alarm/zone29/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1290,"y":760,"wires":[]},{"id":"bb6676fd.8389d8","type":"mqtt out","z":"241a68de.5be0f8","name":"30 bedrooms beam","topic":"home/alarm/zone30/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1320,"y":800,"wires":[]},{"id":"a0459d9e.68c97","type":"mqtt out","z":"241a68de.5be0f8","name":"31 spare rooms beams","topic":"home/alarm/zone31/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1330,"y":840,"wires":[]},{"id":"f073ea4c.2c3f98","type":"mqtt out","z":"241a68de.5be0f8","name":"32 garage","topic":"home/alarm/zone32/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1290,"y":880,"wires":[]},{"id":"441b8e6e.36fbd","type":"mqtt out","z":"241a68de.5be0f8","name":"99 any","topic":"home/alarm/zone99/status","qos":"","retain":"","broker":"d2514633.e1de68","x":1270,"y":920,"wires":[]},{"id":"7074b73d.f54748","type":"comment","z":"241a68de.5be0f8","name":"alarm things","info":"\"stayevent\": \"Event:Non-reportable event;SubEvent:Arm in stay mode\",\n \"armevent\": \"Event:Partition status;SubEvent:Arm partition\",\n \"disarmevent\": \"Event:Partition status;SubEvent:Disarm partition\",\n \n ","x":153.50000762939453,"y":1206,"wires":[]},{"id":"c2f83dcf.538df","type":"change","z":"241a68de.5be0f8","name":"disarmed","rules":[{"t":"set","p":"payload","pt":"msg","to":"disarmed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1116.3108825683594,"y":1402.9417247772217,"wires":[["835ea615.204588"]]},{"id":"de2eb2b6.25506","type":"change","z":"241a68de.5be0f8","name":"armed_home","rules":[{"t":"set","p":"payload","pt":"msg","to":"armed_home","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1117.3109016418457,"y":1489.9417295455933,"wires":[["835ea615.204588"]]},{"id":"a1fe9303.6629c","type":"change","z":"241a68de.5be0f8","name":"armed_away","rules":[{"t":"set","p":"payload","pt":"msg","to":"armed_away","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1111.3109016418457,"y":1523.9417295455933,"wires":[["835ea615.204588"]]},{"id":"ce1caa6f.912748","type":"change","z":"241a68de.5be0f8","name":"pending","rules":[{"t":"set","p":"payload","pt":"msg","to":"pending","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1102.3109016418457,"y":1554.9417295455933,"wires":[["835ea615.204588"]]},{"id":"396bd63b.8375da","type":"change","z":"241a68de.5be0f8","name":"triggered","rules":[{"t":"set","p":"payload","pt":"msg","to":"triggered","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1101.3109016418457,"y":1590.9417295455933,"wires":[["835ea615.204588"]]},{"id":"bb660855.21cd08","type":"comment","z":"241a68de.5be0f8","name":"\"Event:Non-reportable event;SubEvent:Arm in sleep mode\"","info":"\"Event:Non-reportable event;SubEvent:Arm in sleep mode\"","x":605.8024291992188,"y":1413.1549453735352,"wires":[]},{"id":"502778b0.b80248","type":"comment","z":"241a68de.5be0f8","name":"\"Event:Partition status;SubEvent:Exit delay started\"","info":"","x":661.2533760070801,"y":1572.2349472045898,"wires":[]},{"id":"fd64e49f.c47568","type":"comment","z":"241a68de.5be0f8","name":"\"Event:Non-reportable event;SubEvent:Arm in stay mode\"","info":"","x":603.9842224121094,"y":1473.1548910140991,"wires":[]},{"id":"48e894b4.104b4c","type":"change","z":"241a68de.5be0f8","name":"sleep","rules":[{"t":"set","p":"payload","pt":"msg","to":"sleep","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1104.3321838378906,"y":1445.7826642990112,"wires":[["835ea615.204588"]]},{"id":"d688d340.483cd","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"x":900.6958312988281,"y":1418.5098400115967,"wires":[["48e894b4.104b4c"]]},{"id":"8d2843e6.293cd","type":"comment","z":"241a68de.5be0f8","name":"Event:Partition status;SubEvent:Arm partition","info":"","x":628.5332183837891,"y":1519.5184593200684,"wires":[]},{"id":"5efa71d1.b43dd","type":"comment","z":"241a68de.5be0f8","name":"\"disarmevent\": \"Event:Partition status;SubEvent:Disarm partition\",","info":"","x":586.7185516357422,"y":1362.2386665344238,"wires":[]},{"id":"12c31996.45baa6","type":"comment","z":"241a68de.5be0f8","name":"\"Event:Bell status (Partition 1);SubEvent: Bell ON\"","info":"","x":655.8024139404297,"y":1622.2387161254883,"wires":[]},{"id":"2b6ec52a.b533da","type":"mqtt out","z":"241a68de.5be0f8","name":"","topic":"Paradox/C/P1","qos":"","retain":"","broker":"d2514633.e1de68","x":1259.7869415283203,"y":2109.7726516723633,"wires":[]},{"id":"9854661e.a4f338","type":"switch","z":"241a68de.5be0f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Disarm partition","vt":"str"},{"t":"cont","v":"Arm in sleep mode","vt":"str"},{"t":"cont","v":"SubEvent:Arm in stay mode","vt":"str"},{"t":"cont","v":"SubEvent:Arm partition","vt":"str"},{"t":"cont","v":"SubEvent:Exit delay started","vt":"str"},{"t":"cont","v":"Event:Zone in alarm","vt":"str"},{"t":"cont","v":"SubEvent: Bell squawk arm","vt":"str"},{"t":"cont","v":"Bell squawk disarm","vt":"str"},{"t":"else"}],"checkall":"true","outputs":9,"x":570,"y":1080,"wires":[["c2f83dcf.538df"],["48e894b4.104b4c","de2eb2b6.25506"],["de2eb2b6.25506"],["a1fe9303.6629c"],["ce1caa6f.912748"],["396bd63b.8375da"],["ce1caa6f.912748"],["c2f83dcf.538df"],["8c8777a.9117488"]]},{"id":"8c8777a.9117488","type":"debug","z":"241a68de.5be0f8","name":"Unhandled","active":true,"console":"false","complete":"payload","x":1091.2640075683594,"y":1664.2343384135852,"wires":[]},{"id":"153d6dc3.b4e322","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Disarm","payloadType":"str","repeat":"","crontab":"","once":false,"x":879.7868995666504,"y":2037.9543342590332,"wires":[["2b6ec52a.b533da"]]},{"id":"ec40a7a.0233c58","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Arm","payloadType":"str","repeat":"","crontab":"","once":false,"x":877.9686889648438,"y":2096.13623046875,"wires":[["2b6ec52a.b533da"]]},{"id":"ba4bc48a.c13bd8","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Sleep","payloadType":"str","repeat":"","crontab":"","once":false,"x":873.4233016967773,"y":2148.863422393799,"wires":[["2b6ec52a.b533da"]]},{"id":"1024da56.0ed146","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Stay","payloadType":"str","repeat":"","crontab":"","once":false,"x":869.7869262695312,"y":2198.863525390625,"wires":[["2b6ec52a.b533da"]]},{"id":"45458592.2f9e7c","type":"comment","z":"241a68de.5be0f8","name":"Homekit State 3","info":"Publish the following topic to control (Force/Pulse) an output (PGM):\nParadox/C/FO/4/Off\n(C = Control; FO = Force output / PO = Pulse Output, followed by the output number; Then the action (for pulse this will be the intermediate state, e.g. to pulse High then back to Low use \"On\" and vice versa).\nThe payload is not evaluated in this case. Note that output controls can take a few seconds as the script must first be re-authenticated\nPulse outputs are configured for approx. 0.5sec.\nParadox/C/PO/1, Payload: On\nIn this case the payload is used to determine the command to send: Pulse Output 1, On->Off","x":1019.7869110107422,"y":2037.045403957367,"wires":[]},{"id":"f72cfb1d.82e898","type":"comment","z":"241a68de.5be0f8","name":"Expected","info":"","x":731.6051406860352,"y":1979.7726554870605,"wires":[]},{"id":"39114156.34230e","type":"comment","z":"241a68de.5be0f8","name":"Recieved","info":"","x":1280.6960067749023,"y":1965.2273950576782,"wires":[]},{"id":"6c6b0327.4f50ec","type":"comment","z":"241a68de.5be0f8","name":"Homekit State 3","info":"Publish the following topic to control (Force/Pulse) an output (PGM):\nParadox/C/FO/4/Off\n(C = Control; FO = Force output / PO = Pulse Output, followed by the output number; Then the action (for pulse this will be the intermediate state, e.g. to pulse High then back to Low use \"On\" and vice versa).\nThe payload is not evaluated in this case. Note that output controls can take a few seconds as the script must first be re-authenticated\nPulse outputs are configured for approx. 0.5sec.\nParadox/C/PO/1, Payload: On\nIn this case the payload is used to determine the command to send: Pulse Output 1, On->Off","x":1272.51416015625,"y":2045.2271728515625,"wires":[]},{"id":"52e5a2b8.4a690c","type":"mqtt out","z":"241a68de.5be0f8","name":"","topic":"Paradox/Events","qos":"","retain":"","broker":"d2514633.e1de68","x":311.26073455810547,"y":2117.2798223495483,"wires":[]},{"id":"ffcdccc.ad8323","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Event:Partition status;SubEvent:Disarm partition","payloadType":"str","repeat":"","crontab":"","once":false,"x":713.4233283996582,"y":2037.0459051132202,"wires":[["52e5a2b8.4a690c"]]},{"id":"96242612.5c50a8","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Event:Partition status;SubEvent:Arm partition","payloadType":"str","repeat":"","crontab":"","once":false,"x":711.6050605773926,"y":2096.1367683410645,"wires":[["52e5a2b8.4a690c"]]},{"id":"c6c04781.460928","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Event:Non-reportable event;SubEvent:Arm in sleep mode","payloadType":"str","repeat":"","crontab":"","once":false,"x":527.9688034057617,"y":2145.2279720306396,"wires":[["52e5a2b8.4a690c"]]},{"id":"dba736cc.b91d98","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Event:Non-reportable event;SubEvent:Arm in stay mode","payloadType":"str","repeat":"","crontab":"","once":false,"x":528.8778991699219,"y":2192.5000762939453,"wires":[["52e5a2b8.4a690c"]]},{"id":"c3b6eb6b.738a98","type":"comment","z":"241a68de.5be0f8","name":"Homekit State 1","info":"Publish the following topic to control (Force/Pulse) an output (PGM):\nParadox/C/FO/4/Off\n(C = Control; FO = Force output / PO = Pulse Output, followed by the output number; Then the action (for pulse this will be the intermediate state, e.g. to pulse High then back to Low use \"On\" and vice versa).\nThe payload is not evaluated in this case. Note that output controls can take a few seconds as the script must first be re-authenticated\nPulse outputs are configured for approx. 0.5sec.\nParadox/C/PO/1, Payload: On\nIn this case the payload is used to determine the command to send: Pulse Output 1, On->Off","x":1010.6959533691406,"y":2095.227119445801,"wires":[]},{"id":"d54c3a0c.413348","type":"comment","z":"241a68de.5be0f8","name":"Homekit State 2","info":"Publish the following topic to control (Force/Pulse) an output (PGM):\nParadox/C/FO/4/Off\n(C = Control; FO = Force output / PO = Pulse Output, followed by the output number; Then the action (for pulse this will be the intermediate state, e.g. to pulse High then back to Low use \"On\" and vice versa).\nThe payload is not evaluated in this case. Note that output controls can take a few seconds as the script must first be re-authenticated\nPulse outputs are configured for approx. 0.5sec.\nParadox/C/PO/1, Payload: On\nIn this case the payload is used to determine the command to send: Pulse Output 1, On->Off","x":1016.3778686523438,"y":2143.0679321289062,"wires":[]},{"id":"7f21cf35.63dea","type":"comment","z":"241a68de.5be0f8","name":"Homekit State 0","info":"Publish the following topic to control (Force/Pulse) an output (PGM):\nParadox/C/FO/4/Off\n(C = Control; FO = Force output / PO = Pulse Output, followed by the output number; Then the action (for pulse this will be the intermediate state, e.g. to pulse High then back to Low use \"On\" and vice versa).\nThe payload is not evaluated in this case. Note that output controls can take a few seconds as the script must first be re-authenticated\nPulse outputs are configured for approx. 0.5sec.\nParadox/C/PO/1, Payload: On\nIn this case the payload is used to determine the command to send: Pulse Output 1, On->Off","x":1025.2414245605469,"y":2197.0454025268555,"wires":[]},{"id":"44c13ec3.d1ab3","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Event:Zone in alarm","payloadType":"str","repeat":"","crontab":"","once":false,"x":166.94607543945312,"y":2216.704864501953,"wires":[["52e5a2b8.4a690c"]]},{"id":"60003c20.dcfb64","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"Event:Zone in alarm;SubEvent:PATIO BEAM","payloadType":"str","repeat":"","crontab":"","once":false,"x":204.21875,"y":2263.0682277679443,"wires":[["52e5a2b8.4a690c"]]},{"id":"49634e22.e5dad","type":"mqtt in","z":"241a68de.5be0f8","name":"Paradox/Events","topic":"Paradox/Events","qos":"2","broker":"d2514633.e1de68","x":110.46878051757812,"y":2424.0907554626465,"wires":[["71f94bef.3ffd34"]]},{"id":"bed05b4d.6dbe98","type":"mqtt out","z":"241a68de.5be0f8","name":"","topic":"Paradox/Events","qos":"","retain":"","broker":"d2514633.e1de68","x":720.4687194824219,"y":2423.1813468933105,"wires":[]},{"id":"71f94bef.3ffd34","type":"switch","z":"241a68de.5be0f8","name":"find alarm","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Event:Zone in alarm","vt":"str"},{"t":"cont","v":"Event:Zone in alarm;SubEvent:PATIO BEAM","vt":"str"}],"checkall":"true","outputs":2,"x":298.3025894165039,"y":2423.707395553589,"wires":[[],["bb6543b5.5d50e"]]},{"id":"bb6543b5.5d50e","type":"change","z":"241a68de.5be0f8","name":"Event:Zone in alarm;","rules":[{"t":"set","p":"payload","pt":"msg","to":"Event:Zone in alarm","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":503.196044921875,"y":2426.818359375,"wires":[["bed05b4d.6dbe98"]]},{"id":"4bcc7b6a.358284","type":"inject","z":"241a68de.5be0f8","name":"","topic":"","payload":"ALARM","payloadType":"str","repeat":"","crontab":"","once":false,"x":867.9686889648438,"y":2259.772705078125,"wires":[["2b6ec52a.b533da"]]},{"id":"9902b650.ae4348","type":"comment","z":"241a68de.5be0f8","name":"Homekit State 4","info":"Publish the following topic to control (Force/Pulse) an output (PGM):\nParadox/C/FO/4/Off\n(C = Control; FO = Force output / PO = Pulse Output, followed by the output number; Then the action (for pulse this will be the intermediate state, e.g. to pulse High then back to Low use \"On\" and vice versa).\nThe payload is not evaluated in this case. Note that output controls can take a few seconds as the script must first be re-authenticated\nPulse outputs are configured for approx. 0.5sec.\nParadox/C/PO/1, Payload: On\nIn this case the payload is used to determine the command to send: Pulse Output 1, On->Off","x":1013.4231338500977,"y":2257.045629501343,"wires":[]},{"id":"2175e1f6.5268ce","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":200,"wires":[["ca9bcc66.f23c6"]]},{"id":"848bd75e.373b08","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":240,"wires":[["3dcbe38e.579f5c"]]},{"id":"6f181717.bff478","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":280,"wires":[["be2eb8e8.e729b8"]]},{"id":"5d315f2.a6819a","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":320,"wires":[["e778bb35.b608e8"]]},{"id":"a2ab1bd1.79ced8","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":360,"wires":[["4ae95ce4.b64d34"]]},{"id":"3e5359d5.99f586","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":400,"wires":[["aa9e5033.5dffb"]]},{"id":"de6030e0.cfc6c","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":440,"wires":[["4119b44e.ffd8ec"]]},{"id":"4b1ff86d.07a2e8","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":480,"wires":[["f079571b.5fe2e8"]]},{"id":"2a7620f.1e062e","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":520,"wires":[["c531fa62.9025c8"]]},{"id":"2cb2947e.97f7ac","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":560,"wires":[["d617c791.aff008"]]},{"id":"9c3668d5.880168","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":600,"wires":[["8c392700.877398"]]},{"id":"2bdc3663.416fda","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":640,"wires":[["10fd9795.240c88"]]},{"id":"c1ef1fa.eec3be","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":680,"wires":[["b0ef8be1.8a4bf8"]]},{"id":"5ce16795.768af8","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":720,"wires":[["c51f79b.4032b88"]]},{"id":"8d82ee76.8cb49","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":760,"wires":[["2487ac5d.292504"]]},{"id":"307ba803.00edd8","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":800,"wires":[["bb6676fd.8389d8"]]},{"id":"64aea33f.43050c","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":840,"wires":[["a0459d9e.68c97"]]},{"id":"7f939128.c584c","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":880,"wires":[["f073ea4c.2c3f98"]]},{"id":"772a1e5.898b6e","type":"subflow:8617f1a2.afaa7","z":"241a68de.5be0f8","x":1030,"y":920,"wires":[["441b8e6e.36fbd"]]},{"id":"aff1c06f.97a64","type":"debug","z":"241a68de.5be0f8","name":"","active":false,"console":"false","complete":"false","x":1270,"y":1080,"wires":[]},{"id":"fda29296.a0cc","type":"mqtt in","z":"241a68de.5be0f8","name":"","topic":"Paradox/Labels/Outputs","qos":"2","broker":"d2514633.e1de68","x":1050,"y":1080,"wires":[["aff1c06f.97a64"]]},{"id":"d22a5f97.0899","type":"comment","z":"241a68de.5be0f8","name":"Topic For Home Assistant - config.yalm","info":"alarm_control_panel:\n platform: mqtt\n state_topic: \"home/alarm\"\n command_topic: \"Paradox/C/P1\"\n payload_disarm: \"Disarm\"\n# payload_arm_home: \"Stay\"\n# payload_arm_sleep: \"Sleep\"\n payload_arm_home: \"Sleep\"\n payload_arm_away: \"Arm\"","x":1632.5,"y":1390,"wires":[]},{"id":"eebe2dfb.ebc1","type":"comment","z":"241a68de.5be0f8","name":"config.yalm (door)","info":"cover:\n - platform: mqtt\n name: \"Jaco Garage Door\"\n state_topic: \"home/alarm/zone21/status\"\n command_topic: \"Paradox/C/PO/6\"\n payload_open: \"On\"\n payload_close: \"On\"\n state_open: 1\n state_closed: 0","x":1491.25,"y":640,"wires":[]},{"id":"bcdd776d.2198d8","type":"comment","z":"241a68de.5be0f8","name":"Yalm.conf - Alarm Zones","info":"binary_sensor:\n - platform: mqtt\n state_topic: \"home/alarm/zone1/status\"\n name: \"Garage and Front\"\n qos: 0\n payload_on: \"1\"\n payload_off: \"0\"\n device_class: opening\n - platform: mqtt\n state_topic: \"home/alarm/zone2/status\"\n name: \"Study\"\n qos: 0\n payload_on: \"1\"\n payload_off: \"0\"\n device_class: motion","x":1538.125,"y":198.75,"wires":[]},{"id":"10743202.168a96","type":"comment","z":"241a68de.5be0f8","name":"Add Own Zone Names","info":"","x":756.25,"y":358.75,"wires":[]},{"id":"d2514633.e1de68","type":"mqtt-broker","z":"","broker":"172.16.103.9","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"daa2c6d4.8bfd88","type":"mqtt-broker","z":"","broker":"10.0.100.48","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]

cybertza commented 7 years ago

I may recreate this when my understanding of node red is better with the use of https://home-assistant.io/docs/mqtt/discovery/