cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 38 forks source link

example of garageport in node-red (to put in wiki) #13

Closed tvillingett closed 8 years ago

tvillingett commented 8 years ago

@oriolism [{"id":"MQTT.Localhost","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":""},{"id":"12aa7850.0cb9c8","type":"mqtt out","name":"","topic":"homebridge/to/add","qos":"","retain":"","broker":"MQTT.Localhost","x":546,"y":100,"z":"19af2d6a.74e9bb","wires":[]},{"id":"f0ee7d2a.106a38","type":"inject","name":"garage","topic":"","payload":"{\"name\":\"garage2\" }","payloadType":"string","repeat":"","crontab":"","once":false,"x":179,"y":207,"z":"19af2d6a.74e9bb","wires":[["906ea779.cc4cd"]]},{"id":"906ea779.cc4cd","type":"mqtt out","name":"","topic":"homebridge/to/remove","qos":"","retain":"","broker":"MQTT.Localhost","x":551,"y":181,"z":"19af2d6a.74e9bb","wires":[]},{"id":"8031a090.b05a4","type":"comment","name":"garage test","info":"","x":228,"y":67,"z":"19af2d6a.74e9bb","wires":[]},{"id":"aa578889.1bda6","type":"mqtt out","name":"","topic":"homebridge/to/set","qos":"","retain":"","broker":"MQTT.Localhost","x":592,"y":324,"z":"19af2d6a.74e9bb","wires":[]},{"id":"931355d7.bb2688","type":"template","name":"TargetDoorState","field":"payload","format":"handlebars","template":"{\"name\":\"garage2\",\"characteristic\":\"TargetDoorState\",\"value\": {{payload}}}","x":330,"y":307,"z":"19af2d6a.74e9bb","wires":[["aa578889.1bda6"]]},{"id":"a443fc1c.d22f1","type":"template","name":"CurrentDoorState","field":"payload","format":"handlebars","template":"{\"name\":\"garage2\",\"characteristic\":\"CurrentDoorState\",\"value\": {{payload}}}","x":333,"y":359,"z":"19af2d6a.74e9bb","wires":[["aa578889.1bda6"]]},{"id":"23cfbe0d.9a55b2","type":"inject","name":"garage","topic":"","payload":"{\"name\":\"garage2\",\"service\":\"GarageDoorOpener\"}","payloadType":"string","repeat":"","crontab":"","once":false,"x":148,"y":146,"z":"19af2d6a.74e9bb","wires":[["12aa7850.0cb9c8"]]},{"id":"b63cfa6c.fc7118","type":"inject","name":"0 = open","topic":"","payload":"0","payloadType":"string","repeat":"","crontab":"","once":false,"x":115,"y":449,"z":"19af2d6a.74e9bb","wires":[["a443fc1c.d22f1"]]},{"id":"cd6858e4.62eb78","type":"inject","name":"1 = closed","topic":"","payload":"1","payloadType":"string","repeat":"","crontab":"","once":false,"x":114,"y":495,"z":"19af2d6a.74e9bb","wires":[["a443fc1c.d22f1"]]},{"id":"850ce9b1.89a468","type":"inject","name":"2 = opening","topic":"","payload":"2","payloadType":"string","repeat":"","crontab":"","once":false,"x":120,"y":558,"z":"19af2d6a.74e9bb","wires":[["a443fc1c.d22f1"]]},{"id":"2ba9731d.7cf0b4","type":"inject","name":"3 = closing","topic":"","payload":"3","payloadType":"string","repeat":"","crontab":"","once":false,"x":117,"y":599,"z":"19af2d6a.74e9bb","wires":[["a443fc1c.d22f1"]]},{"id":"13c3e3eb.b70464","type":"comment","name":"current door states","info":"// The value property of CurrentDoorState must be one of the following:\nCharacteristic.CurrentDoorState.OPEN = 0;\nCharacteristic.CurrentDoorState.CLOSED = 1;\nCharacteristic.CurrentDoorState.OPENING = 2;\nCharacteristic.CurrentDoorState.CLOSING = 3;\nCharacteristic.CurrentDoorState.STOPPED = 4;","x":105,"y":405,"z":"19af2d6a.74e9bb","wires":[]},{"id":"7ff1935.d324b6c","type":"inject","name":"4 = stopped","topic":"","payload":"4","payloadType":"string","repeat":"","crontab":"","once":false,"x":116,"y":652,"z":"19af2d6a.74e9bb","wires":[["a443fc1c.d22f1"]]},{"id":"dfe4461c.b25ec","type":"inject","name":"0 = open","topic":"","payload":"0","payloadType":"string","repeat":"","crontab":"","once":false,"x":108,"y":290,"z":"19af2d6a.74e9bb","wires":[["931355d7.bb2688"]]},{"id":"f7f1ff78.fa89d","type":"inject","name":"1 = closed","topic":"","payload":"1","payloadType":"string","repeat":"","crontab":"","once":false,"x":114,"y":332,"z":"19af2d6a.74e9bb","wires":[["931355d7.bb2688"]]},{"id":"5a4e7ac.a7e6784","type":"template","name":"ObstructionDetected","field":"payload","format":"handlebars","template":"{\"name\":\"garage2\",\"characteristic\":\"ObstructionDetected\",\"value\": {{payload}}}","x":406,"y":538,"z":"19af2d6a.74e9bb","wires":[["aa578889.1bda6"]]},{"id":"c9d15045.2531f","type":"inject","name":"0 = open","topic":"","payload":"0","payloadType":"string","repeat":"","crontab":"","once":false,"x":298,"y":481,"z":"19af2d6a.74e9bb","wires":[["5a4e7ac.a7e6784"]]},{"id":"fd4169d5.79613","type":"inject","name":"1 = closed","topic":"","payload":"1","payloadType":"string","repeat":"","crontab":"","once":false,"x":293,"y":443,"z":"19af2d6a.74e9bb","wires":[["5a4e7ac.a7e6784"]]}]

cflurin commented 8 years ago

@tvillingett: awesome thanks. https://github.com/cflurin/homebridge-mqtt/wiki/garageport

mnopi commented 7 years ago

I apologise for my ignorance. I have been playing around with Node-read and homebridge-MQTT and I can not get the homebridge/to/add /set & remove to be connected in Node-Red.

It keeps in Connecting but never gets Connected. I probably have a fundamental issue or lack of knowledge. I read the plug-in description and it says perfect to be used with Node-Red so I was under the impression that an mqtt server was not needed. I have an Arduino One, Node-Red and Homebridge. I was able to get button press from my Arduino to Node-Red and outputs from Node-Red to Arduino but I can not get Homebridge to engage. I have used all IPs that I could think of considering Node-red and homebridge but to be honest with you I am not sure if I need mosquitto in addition to the existing configuration. I thought I would be enough with Arduino->NodeRed->Homebridge. Do I need Arduino->NodeRed->Mosquito->Homebridge?

I have tried on config.json url = http://127.0.0.1:1880 (which is the Node-red IP and port that I used to interface. url = http://127.0.0.1:1883 (which is the port that you mention), url = http://127.0.0.1:51826 (which is Homebridge port... does not make sense but I was trying!), url = http://localhost:51826, url = http://localhost:1880, url = http://localhost:1883 . I always get the following error: [mqtt] connect error! (url =

I also tried all combinations in the hombre bridge/to/set & /add that I was mentioning above for the IP and port of mqtt out.

Thanks in advance for your patient and support!

José A.

cflurin commented 7 years ago

You need a MQTT-Broker e.g. mosquitto

mnopi commented 7 years ago

I did that. Thanks

Sent from my iPhone

On 2 Jun 2017, at 11:17, cflurin notifications@github.com wrote:

You need a MQTT-Broker e.g. mosquitto

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.