Little problem with flow / function

i´m new to node-red and new to this forum.
until now i´m using domoticz with zigbee, mqtt and wifi.

since a few days i try to set up my new sonoff NSPanel. the two relais buttons are no problem and working fine with domoticz.
my issues started with the touch panel / touch buttons.

in the screenshot i got a, more or less, working flow.
i got the information from my domoticz, the idx of my device.

which leads into the following function:

    "type": "object",
    "properties": {
        "payload.nvalue": { "type": "string" }
     "if": {
        "properties": {
            "payload.nvalue": { 
              "enum": ["1"] 
    "then": { 

in general it seems that the command arrives at the nspanel, and is switching. but it seems that both functions, on and off, were triggert both and so it happen that the button will turn on and after a second off again.
it happen if i toggle the button, on or off, both trigger both functions. so turn on -> nspanel button will go on and off after a second.

hope someone can help me to fix it, would be really great.

That does not appear to be a node-red function. Where does that function definition go?


after i tried some little other things, or better the other direction i got it ...

i added two switches between idx and the functions.

this is how it works.

now i can toggle the button in my domoticz and through node red it will be toggled on my nspanel touch screen.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.