Hello,
I bought an Aeontec Smartthings hub en 3 zigbee switches. The goal of the project is integrate Smarthings in Domoticz, but as almost always i have some trouble on the way:
I created a flow with a debugnode at the end, before connect it to domoticz.
when i deploy the flow i get debug output On or Off (the state of the switch.
when i push the Injectnode i get the failure [ msg : string[13] "Invalid topic"]
I don't know what node that 'Zigbee Switch 1' node is (node-red-contrib-??)
It could also be that the inject node still has the default msg.topic enabled with an empty string possibly causing the error (if the zigbee node also accepts msg.topic as input, which you can hopefully read in the documentation of the node)
the config discribed under SMARTAPP and "...follow these steps" are (for me) not the reality of to day anymore. Anyway i could not a possibility to create a project, etc, etc.
BUT..,
After some searching I changed the inject node :
Pushing the button or setting a pull by timeinterval results in a nice output (no errors) which i connected to a MQTT OUT-node configured for Domoticz. The result is visibile in a virtual swicht in Domoticz. One part of the project finished.
Now the other part: The output of the virtual switch (On or Off) in Domoticz to the switch in Smartthings.
The code for your function node will depend on the incoming message. Please provide an example of the incoming msg that would be received. If you place a debug node after the node labeled Filter Switch and send a message it will show up in the debug panel.
But you will probably need something like the following:
msg.topic = "switch";
msg.payload = { "value": msg.variable }; // you will need to replace the word variable with the message property used on the incoming msg
push the inject gives the debug408 output on the right side of the screen.
the "domoticz/out' node filtered by an Mqtt explorer when switching the virtual Zigbee switch in Domoticz result in :
Question:
how do i need to config the switch to filter the idx:10903 from all the domoticz/out data?
how do i need to config the function 2/3 in order to put the Zigbee Switch 1 on or off
But to be honest, it is difficult to help when in each response you rename your nodes and provide an incomplete picture of what is going on. For example, why are there 2 functions nodes now? They will likely cause an issue with each other because you are duplicating the messages sent to the "Zigbee Switch 1" node now. Furthermore, set your "debug" nodes to output the complete msg object not just the msg.payload, also expanding the result in the debug panel can help too.
That is already a JavaScript object. By adding the JSON node you have converted it to a string. You don't want to do that. Take the JSON node out.
Also note that there is not a msg.payload.value. There is an nvalue, perhaps that is what you want.
for clarity:
HaroldPeters asked a debug node (412). As described earlier, there was no output on 412. I added json in between, resulting in the output given earlier.
i took out the json (your advice).
Your wrote; 'there is not a msg.payload.value.., there is an nvalue" so i edited the function node and replaced the msg.payload.value for msg.payload.nvalue.
Sorry, I have no idea what a virtual switch in domoticz is. If there is no output in the debug node connected to the domoticz out then there is not much I can do.
I think perhaps you might find it useful to read this, and watch the videos. Working with messages : Node-RED. Make sure you understand the concepts described there.
See debug 413; the value of the Zigbee Switch 1 is 0 (svalue =off) and can change to 1(svalue =On).
When i push the switchbutton in domoticz the value of the button in smartthings is shown (0 or 1).
What I want is when I switch the switch button in domoticz, for example from On to Off, the switch button in smartthings also switches from On to Off.
Does the Inject node do what you want? If it does then compare the output of the Inject node with the output of the function node. If they are the same then it will work.