Ok, so I have made this flow that based on various inputs sends an on/off signal that I would like to use for turning on/off a ventilation system.
I have flashed a Sonoff with tasmota, and through the sonoffs own web interface, I can turn it on or off.
So my missing link is to use the RasPi running my node-red flow to turn it on/off.
To avoid to much complexity, I set out planning on running the MQTT broker within node-red, by using: "node-red-contrib-mqtt-broker".
Further, I was thinking to use "node-red-contrib-sonoff-tasmota" to control the sonoff.
However, I don't know anything about mqtt, and my trials and errors have not shown any progress.
My tasmota is set up like this, the host ip being my RasPi.
In the simple flow below it shows how I tried to do this.... Anybody who knows of a "best" way to link node-red and tasmota sonoff's??
[{"id":"690e0ad2.a7a794","type":"tab","label":"MQTT","disabled":false,"info":""},{"id":"69fa4ac6.14cf14","type":"mosca in","z":"690e0ad2.a7a794","mqtt_port":1883,"mqtt_ws_port":8080,"name":"MQTT-Broker","username":"","password":"","dburl":"","x":281,"y":495,"wires":[[]]},{"id":"700f7371.29108c","type":"Sonoff device","z":"690e0ad2.a7a794","mode":"0","broker":"f2ef30e2.c3d8c","device":"Basement_Vent","name":"","onValue":"ON","offValue":"OFF","cmdPrefix":"cmnd","statPrefix":"stat","telePrefix":"tele","x":295,"y":422,"wires":[["1232582d.b87278"]]},{"id":"ed784a59.633a18","type":"inject","z":"690e0ad2.a7a794","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":91,"y":196,"wires":[["700f7371.29108c"]]},{"id":"516f37d.e1c6248","type":"inject","z":"690e0ad2.a7a794","name":"","topic":"Basement_Vent","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":142,"y":239,"wires":[["700f7371.29108c"]]},{"id":"1232582d.b87278","type":"debug","z":"690e0ad2.a7a794","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":515,"y":423,"wires":[]},{"id":"f2ef30e2.c3d8c","type":"mqtt-broker","z":"","name":"MQTT_tonsgaard","broker":"192.168.1.45","port":"1883","clientid":"MQTT-broker","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":""}]
Any help much appreciated - THANKS