DaveMDS / node-red-contrib-tasmota

Tasmota devices for NodeRed
MIT License
24 stars 9 forks source link

command structure unclear #9

Closed brjhaverkamp closed 4 years ago

brjhaverkamp commented 4 years ago

Thanks for this node red contribution! I'm especially looking forward to using the raw commands. I'm trying to make a sonoff switch blink the number of hours on the hour to create a time signal

Reading the readme.md, however, I failed to understand how the new raw command works. Maybe the description can be made a bit more clear?

I read in the readme.md that the structure has 3 possible formats:

  1. string payload: 'CMD <param>'
  2. string list payload: ['CMD <param>', 'CMD <param>', ...]
  3. object payload: {'CMD': 'param', 'CMD': 'param', ...}

But how is param formated? I need a command and a variable, like BlinkCount 12 or BlinkTime 3 Or is 'CMD' the command as used by Tasmota? i.e. BlinkCount: 12 Perhaps you can add a few examples to clarify the text?

Also I found a small typo on line 75: sand-> send

Regards,

Bert

DaveMDS commented 4 years ago

Hi, yes, CMD is the tasmota command and is the tasmota param... so just send the string "BlinkCount 12" or "BlinkTime 3" with the topic "command" or a list to send both at once: ["BlinkCount 12", "BlinkTime 3"]

I'm a bit busy with other stuff right now, it should be great if you could contribute to docs improvement with a pull request ;)

Let me know if you need more help

Note that you need the git version to send raw commands, as stated in the CHANGELOG file

DaveMDS commented 4 years ago

Btw, I just released v0.9.4, that include raw tasmota commands, so you just need to update the node from node-red

brjhaverkamp commented 4 years ago

Hi DaveMS,

I upgraded to v0.9.4. So I am now actually trying the command list out. But still have not been able to get it going. Even a single command is not working yet. In an inject node, I filled in "BlinkTime 3" as payload and command as topic but there is no output, not even on the debug console. What am I overlooking?

I am able to send an on, off and toggle command via the tamota-switch node. So that one is working.

Btw, the plan is indeed to help some with the documentation, as soon as I have figured out how this works:-)

DaveMDS commented 4 years ago

Hi, look at the console in your tasmota web interface, you should see all the received commands there.

"BlinkTime 3" just set the time of the blinks, it does not actually make the light blink. to start the blinking you must send "Power blink" (always on the "command" topic)

This one works for me: blink The first 2 inject nodes just change the tasmota configuration, while the last one actually start the blinks

brjhaverkamp commented 4 years ago

Ha, thanks for the screenshot. From the titles, I noticed you are lacking the quotes. So if I put in BlinkCount 3 instead of "BlinkCount 3" it is working. So the individual commands are now in order! thanks. But I am still struggling with the right syntax to input a series of commands: In my case I indeed need something like ["BlinkCount 12", "BlinkTime 3", "Power Blink"] as the payload.

But if I include your example from your earlier mail ["BlinkCount 12", "BlinkTime 3"], I get an "unknown command" in the debug console. What is the right format?

Attached a screenshot from my side:

Blink

DaveMDS commented 4 years ago

You are quite there :) you must send a JSON list, not a string, just set the payload type to JSON instead of string. blink2 This will start 5 blinks

brjhaverkamp commented 4 years ago

That was the trick indeed! Thanks. My garden pump is now "chiming" the hour:-) I created a pull request with an update of the documentation. Let me know what you think.

Thanks for the help and the great work.