Turn on/ off with switch node a zigbee device

Hello

I need your help again :slight_smile:

I have built e simple flow. Inject-node -> switch-node -> Action (e.g. light on/off). this function very well:

but i change the nodes lights with a "osram zigbee light", then function this not:

I understand this not. is a inject-node, then can i start the osram zigbee light without problem

can someone please explain that to me?? Thank

After the smartbutton zigbee node put a debug node.

See what it is sending.

There is a possibility it is sending a text 1 rather than a number 1.
And so the switch node won't know what to do with the signal.

Hi, thanks for reply.
Right. It is a zigbee device is a button. This is not the Problem. The Problem is the Interface between Switch and light. When i use e.g. a Non zigbee light, Then function well

I think you are really missing what I am asking you to do.

You are saying the switch node isn't working.

I'm pretty sure it is. You just don't have something set correctly.

Again: Put a debug node where I showed you, make it show all the message. deploy and get the zigbee thing to send a message.

What appears in the debug output?

Oh, and I don't think this is helping:

blah

But until you have the debug node and show the output, I can't be 100% sure.

Hi,

I had done that. When i click the button, then i get the fellows output in the debug window:

I think, @Trying_to_learn means that:
image

Sorry, no @DamianosS. I wanted to see the raw output from the zigbee node.

But, looking at the debug node, I concur is isn't a simple 0 or 1 output.

Alas I am not smart enough to confirm that it is msg.payload.onOff

I was suspicious that the switch node wasn't seeing the correct information in the message.

Someone else is going to have to help you why it isn't working. But I feel it is the switch node and what you have in the msg...... part.

What you could try is click where I indicate (expand the tree)

Then you can find out what the correct path is.
That will be selectable to the right with the >_ icon (copy path).

Then you paste it in the msg...... part of the switch node.

Well, that's what I think you need to do.

Though I shall (now) admit it would be a good idea to do what @DamianosS did suggest also.
That way you see the message coming out of the zigbee node and then the message/s going to the other (purple) nodes.

thank you DamianosS for reply

Ok, so we have moved on a bit quicker.

All is good.

But there is now a problem with the payloads.

one fix is to do this:

Put a change node between the switch and the debug node. (Two in total)

So the flow would look like this:

Then each change node would be:

Of course one would be 1 and the other be a 0.

That will fix the problem with the wrong payload. you just feed that output into the purple nodes to switch the light on/off.

thanks for help...

Here the screenshot:

grafik

Yeah, so you move the mouse to the onOff line and look to the right you will see the >_ icon.

But that is by the by. Stick a change node as I showed above and set them as I showed and they will convert the msg.payload to either 0 or 1.

grafik

result:
payload.onOff

Correct. That is/was just FYI.

But to get the bulb to turn on or off as you want, you will need to use the change nodes.

thank you for your great efforts. but unfortunately that doesn't work with a switch node either. I'm starting to despair. if I replace the switch node with an inject not, then I can switch the lamp on and off. when i change the zigbee-light-node with a RF433 light/bulb then function this very well. this is a sign that the switch node is set correctly. the command is passed on.

now i even get an error message

Error: Command 0x00158d0XXXXXXXX/1 genOnOff.on({"onOff":0}, {"timeout":6000,"manufacturerCode":null,"disableDefaultResponse":false}) failed (Error: Timeout - 40061 - 1 - 210 - 6 - 11 after 6000ms)

if you manually click the button, it works too

difficult thing :frowning: :weary: :tired_face: :triumph:

So why did you include it in your posts? You (basically) stuck it there in your examples so much as to say "But this works!".

I would suggest you forget the zigbee part until you get the turning the lights on/off working.
Once you can see you can turn them on/off (or what ever it is you want to do) then you start putting things at the input to do it automagically.

Alas it is kind of going backwards. But there is good reason for this.

At the end you want something to happen. (That is at the end of the code. Therefore at the right of the screen.)

Once you get that working with an inject node sending simple messages, you then start to build the flow (program/code) from right to left.

If something stops working, you can then establish where it stopped working.

This way you are really throwing yourself in the deep end and there are a lot of unknowns.

By all means do it. (I have done it a lot.) But there are limits to what people can (and will) do to help you.

I also have a whole lot of other problems I am trying to work out for myself. (See my name?)

Good luck.

1 Like

I found the solution with help from Developer this Nodes.

The Problem was, the ZigBee-Smartbutton sends own Attributes and overwrite/delete the attributtes from the Zigbee Bulb. With a function node between bulb and switch reset the Attributs from zigbee smartbutton. This function now !

The Content of the function node:

msg = {};
msg.payload = true;
return msg;

this reset all information from the zigbee smartbutton. great thanks for help!

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