Try power1 1 for on and power1 0 for off. It’s best to always enumerate the relay.
Sent from Mail for Windows
--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/6bfec602-3b3a-40b8-985b-bc7a6302a022n%40googlegroups.com.
I may have missed part of question. Make sure you know if your relay turns on with active high or an active low.
Most importantly.
Also check to see if your sending the message in a string, variable, number . ….. sometimes we miss the little thing that makes the difference.
Cheers.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/A2D49E54-AC22-4329-96BD-11206099AECE%40hxcore.ol.
Sorry better info here.
Look at the 2 pictures the one where msg is set to off make sure its in string “az”
Second make sure the message topic is set to your unit. So it should be cmnd/auqua1/POWER


From: Philip Knowles
Sent: Monday, January 2, 2023 11:53 PM
To: Ulf Holt; TasmotaUsers
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/A2D49E54-AC22-4329-96BD-11206099AECE%40hxcore.ol.
I'm sure this is a syntax problem.
This will turn set the pin High:

This will give an error message:

I have tried using Power1 0 instead, still not working.
I have tried cmnd/Aqua1 in the Topic field and the Power1 0 in the text field, same problem.
Sorry for being stupid!
Best regards
Ulf
Try this (import into node-red. Change the MQTT information to suit yours.
{
"id": "c7a2a0dd595c376b",
"type": "inject",
"z": "15a1f47e5892aace",
"name": "ON",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "cmnd/Aqara/power",
"payload": "1",
"payloadType": "str",
"x": 90,
"y": 120,
"wires": [
[
"884c18039c8bfaaa"
]
]
},
{
"id": "487f81a2867e69cc",
"type": "inject",
"z": "15a1f47e5892aace",
"name": "OFF",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "cmnd/Aqara/power",
"payload": "0",
"payloadType": "str",
"x": 90,
"y": 180,
"wires": [
[
"884c18039c8bfaaa"
]
]
},
{
"id": "884c18039c8bfaaa",
"type": "mqtt out",
"z": "15a1f47e5892aace",
"name": "Aqara",
"topic": "",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "47f1dec978a181e1",
"x": 340,
"y": 160,
"wires": []
},
{
"id": "47f1dec978a181e1",
"type": "mqtt-broker",
"name": "YourMQTTBroker",
"broker": "192.168.xxx.xxx",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"sessionExpiry": ""
}
]
Sent from Mail for Windows
From: ulf....@gmail.com
Sent: 03 January 2023 10:17
To: Philip Knowles; sonof...@googlegroups.com
Subject: SV: Turning on / off relay using MQTT
I'm sure this is a syntax problem.
This will turn set the pin High:

This will give an error message:

I have tried using Power1 0 instead, still not working.
I have tried cmnd/Aqua1 in the Topic field and the Power1 0 in the text field, same problem.
Sorry for being stupid!
Best regards
Ulf
Fra: Philip Knowles <knowles...@gmail.com>
Sendt: tirsdag 3. januar 2023 10:01
Til: billy jack <billyj...@gmail.com>; Ulf Holt <ulf....@gmail.com>; TasmotaUsers <sonof...@googlegroups.com>
Emne: Re: Turning on / off relay using MQTT
Tasmota doesn't care if it's a string or number. If the payload in node-red is on or 1 for ON or off or 0 for OFF provided that you get the topic right it will work. As I said before it is better to use an enumerated power topic. I always use 0 and 1 because it's easier to do maths changes in rules to change the value.
The OP didn't appear to use a payload in the cmnd to turn on. He may be using msg.payload set earlier in the flow.
A console listing might help work out what's going on.
Sent from Outlook for Android
![]()
Thank you, Philip.
Import did not work (Not a Jason Array) but I saw what you were doing, so I just changed the Topic and the Text accordingly – worked like a dream. It's all in the small details:

And use 0 to turn off.
All the best from