Hi
i know how to publish a switch status through mqtt and display on node-red dashboard
but now i am stuck on the other way around, how can i turn off an LED through subcribe?
thanks
Jonathan
How to use node-red to turn off an LED
Forumsregeln
Bitte beachte die Forumsregeln!
Bitte beachte die Forumsregeln!
Re: How to use node-red to turn off an LED
You can write a python prog where your incomming MQTT messages affect the TXT 4 IO (similar like you tried in RoboProCoding - I did this in plain python code...)
But the easier way to handle the IO of the TXT4 direct from Node-Red is to use the TXT4 API with HTTP requests.
With that you do not need a Python software layer to use the IO.

But the easier way to handle the IO of the TXT4 direct from Node-Red is to use the TXT4 API with HTTP requests.
With that you do not need a Python software layer to use the IO.

- Dateianhänge
-
- API_Flow.png (138.83 KiB) 1185 mal betrachtet
Re: How to use node-red to turn off an LED
Hi
"But the easier way to handle the IO of the TXT4 direct from Node-Red is to use the TXT4 API with HTTP requests.
With that you do not need a Python software layer to use the IO."
thanks for guiding me, and i tried to figure out whole day, now txt4.0 can receive the message, but the LED just cant be turn off
can you help me to look through and see which part had i do wrongly?tyty
my RPC my flow my dashboard, know how to "control" the LED on dashboard only
thanks
Jonathan
"But the easier way to handle the IO of the TXT4 direct from Node-Red is to use the TXT4 API with HTTP requests.
With that you do not need a Python software layer to use the IO."
thanks for guiding me, and i tried to figure out whole day, now txt4.0 can receive the message, but the LED just cant be turn off
can you help me to look through and see which part had i do wrongly?tyty
my RPC my flow my dashboard, know how to "control" the LED on dashboard only
thanks
Jonathan
Re: How to use node-red to turn off an LED
I do not often use Blockly - with that I could not help you much.
I am using plain Python code - there I initialized my TXT4 IO as lamp (PWM) outputs and declared MQTT topics for the PWM setpoints.
With incoming MQTT message on the setpoint topic I wrote the setpoint value to the TXT output.
0 for LED OFF and 255 for LED ON.
I am using plain Python code - there I initialized my TXT4 IO as lamp (PWM) outputs and declared MQTT topics for the PWM setpoints.
With incoming MQTT message on the setpoint topic I wrote the setpoint value to the TXT output.
0 for LED OFF and 255 for LED ON.