make ON OFF actuator more flexible (#481)

* make ON OFF actuator more flexible

enable to choose the pin when sending the MQTT command

* add on off environment example
This commit is contained in:
Florian authored and GitHub committed 2019-11-04 20:51:29 +01:00
1 parent 81201cf7de
commit 12bd11bbe1
5 files changed
+73 -43

No files matched your search

+11 -3
View File
@@ -3,13 +3,21 @@
This module enables to actuate things by giving to a PIN a HIGH or LOW value corresponding to an MQTT topic.
Example usage: Connect a transistor to power a relay, connect a led...
So as to pilot the pin use the following commands:
So as to pilot the pin use the following commands with [simple receiving](../upload/pio.md#api):
OFF command:
`mosquitto_pub -t home/OpenMQTTGateway_MEGA/commands/MQTTtoONOFF -m OFF`
`mosquitto_pub -t home/OpenMQTTGateway_MEGA/commands/MQTTtoONOFF/setOFF -m 15`
ON command
`mosquitto_pub -t home/OpenMQTTGateway_MEGA/commands/MQTTtoONOFF -m ON`
`mosquitto_pub -t home/OpenMQTTGateway_MEGA/commands/MQTTtoONOFF/setON -m 15`
or with [json receiving](../upload/pio.md#api)
OFF command:
`mosquitto_pub -t home/OpenMQTTGateway_MEGA/commands/MQTTtoONOFF -m '{"pin":15,"state":0}'`
ON command
`mosquitto_pub -t home/OpenMQTTGateway_MEGA/commands/MQTTtoONOFF -m '{"pin":15,"state":1}'`
## FASTLED