Closed kilbamoo closed 5 years ago
Hi Here is an example for node-red:
in a change node (set msg.payload) map the value to "on" "off" and send it to sonoff6:
I was hoping to see how to add a sensor like luminosity tsl2561 on esp board running tasmota firmware in this topic. Got it running in node red with simple output debug by listening to the published message.
Tried this without luck...:
[{"id":"51c396a1.3bc208","type":"mqtt out","z":"e9cba079.49c4c","name":"","topic":"homebridge/to/add","qos":"","retain":"","broker":"1ea7980d.490fa8","x":470,"y":80,"wires":[]},{"id":"2ee5a220.4e980e","type":"inject","z":"e9cba079.49c4c","name":"add sensor","topic":"tele/sonoff11/SENSOR","payload":"{\"name\":\"light level\",\"service_name\":\"illum\",\"service\":\"Light Sensor\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":"","x":140,"y":80,"wires":[["51c396a1.3bc208","8da97b41.4d6c6"]]},{"id":"8da97b41.4d6c6","type":"mqtt out","z":"e9cba079.49c4c","name":"","topic":"homebridge/to/add/service","qos":"","retain":"","broker":"1ea7980d.490fa8","x":500,"y":140,"wires":[]},{"id":"1ea7980d.490fa8","type":"mqtt-broker","z":"","name":"mqtt@raspberr2","broker":"192.168.2.61","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]
How do I add a device running tasmota? Example a sonoff? First I create an inject node: Payload, choose json from drop down and fill in {"name":"MyFirstSwitch","service":"Switch"} Give a random name "Test" Then I create an mqtt output 'homebridge/to/add' as topic with my mqtt server filled in. I connect these two buttons and deploy. Click the inject node and I see my switch in homekit. Now to toggle the sonoff on and off, I'm stuck. I don't know how to define the two inject nodes. mqtt topic is in my case cmnd/sonoff6/power Once these two inject nodes are created I suppose I just have to link them to an mqtt output homebridge/to/set.