Operating switch manually, doesnt bring anything to the debug window, your flow gives this :FireWizard wrote: ↑Tuesday 16 March 2021 21:56 Hello @tontze
You said:
I was not sure about the example in the Smartthings documentation.Nope. your example didn't work, but i figured it out from your example and from my earlier inject node. This is working:
I already said:
But perfect, that it is working now.I found the msg.topic quite confusing.
So, as I'm not sure either msg.topic should be set to "switch" or msg.payload.topic should be set to "switch" or or both.
I configured them both, just to be sure.
I have one small remark to your code.
The first line of your code shows:
and if you click in the function node you will see a small yellow triangle with the text: 'msg' is already defined.var msg = {
It is not necessary to declare the variable msg, as this is already done (by default).
So the contents of the function node should become:
Code: Select all
msg = { topic: "switch", payload: { value: msg.payload.nvalue } } return msg;
Can you operate the lamp, connected to the Smartthings node, and see if something is shown in the last "Debug"node.It is working now I can switch smartthings switch from domoticz Now just need to make it other way around
Or if this is not possible can you test the following flow:
I expect you will see, something like:Code: Select all
[{"id":"7c7791de.29521","type":"inject","z":"4e92e308.9bb32c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":280,"wires":[["b994970e.927188"]]},{"id":"b6f73d8f.ef4cc8","type":"smartthings-node-onoff","z":"4e92e308.9bb32c","conf":"666c7bf2.c25414","name":"Kitchen Lights","device":"e162c5c6-80d2-46e1-aaef-741a39f934fe","x":640,"y":280,"wires":[["635ae9af.854d9"]]},{"id":"b994970e.927188","type":"function","z":"4e92e308.9bb32c","name":"Function Kitchen Light","func":"msg = {\n topic: \"update\",\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":400,"y":280,"wires":[["b6f73d8f.ef4cc8"]]},{"id":"635ae9af.854d9","type":"debug","z":"4e92e308.9bb32c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":280,"wires":[]},{"id":"666c7bf2.c25414","type":"smartthings-config","name":"ST","token":"xxx"}]
Screenshot_Smartthings2.png
If this is the case, can you test the following flow:
Connect the output of the Smartthings node to the input of the "Function" node.
And configure the MQTT output node, according to your configuration.
Awaiting your response,Code: Select all
[{"id":"191ec999.485656","type":"function","z":"4e92e308.9bb32c","name":"","func":"if (msg.payload.value === 1 )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": 11, \"switchcmd\": \"On\" };\n}\nelse if ( msg.payload.value === 0 )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": 11, \"switchcmd\": \"Off\" };\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1040,"y":100,"wires":[["d805ccf1.c0753"]]},{"id":"d805ccf1.c0753","type":"mqtt out","z":"4e92e308.9bb32c","name":"","topic":"domoticz/in","qos":"1","retain":"false","broker":"f9f13036.e28b58","x":1230,"y":100,"wires":[]},{"id":"f9f13036.e28b58","type":"mqtt-broker","name":"localhost","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Regards
Smartthings integration to domoticz Topic is solved
Moderators: leecollings, remb0
-
- Posts: 317
- Joined: Thursday 12 January 2017 15:30
- Target OS: Linux
- Domoticz version: Beta Ch
- Location: Finland
- Contact:
Re: Smartthings integration to domoticz
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
- FireWizard
- Posts: 1745
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Smartthings integration to domoticz
Hello @tontze,
Can you change the settings of the "Debug" node, to show "the complete message object"?
Test it with both Lamp ON and Lamp OFF.
Can you run this flow with both Lamp ON and Lamp OFF.
Regards
This shows that currently no payload is sent by the Smartthings node.Operating switch manually, doesnt bring anything to the debug window
Can you change the settings of the "Debug" node, to show "the complete message object"?
Test it with both Lamp ON and Lamp OFF.
This is the same as my test flow.your flow gives this
Can you run this flow with both Lamp ON and Lamp OFF.
Regards
-
- Posts: 317
- Joined: Thursday 12 January 2017 15:30
- Target OS: Linux
- Domoticz version: Beta Ch
- Location: Finland
- Contact:
Re: Smartthings integration to domoticz
Hm, i thin there is a bug in this :
https://github.com/otaviojr/node-red-co ... /issues/47
It says nodes state should be updated via webhooks automatically, but it does not :/
https://github.com/otaviojr/node-red-co ... /issues/47
It says nodes state should be updated via webhooks automatically, but it does not :/
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
- FireWizard
- Posts: 1745
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Smartthings integration to domoticz
Hello @tontze
Okay, that explains, why we get an old value
Obviously it is only on/off switch not updating. Do you have something else we can try?
Regards
Okay, that explains, why we get an old value
Obviously it is only on/off switch not updating. Do you have something else we can try?
Regards
-
- Posts: 317
- Joined: Thursday 12 January 2017 15:30
- Target OS: Linux
- Domoticz version: Beta Ch
- Location: Finland
- Contact:
Re: Smartthings integration to domoticz
Heh, i rebooted nodered machine and it started working, dunno what was wrong, but now when i turn lights on from the actual switch i do get :
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
- FireWizard
- Posts: 1745
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Smartthings integration to domoticz
Hello @tontze
However, I saw that you changed the picture.
The previous picture showed 4 times the same message, this one shows only 2 messages.
Does this mean that you now receive only 2 messages?
Could have multiple reasons.
1. Do you have MQTT loop activated?
("Prevent loop" setting in MQTT hardware)
2. Which Domoticz version are you running?
Stable version? Or latest beta?
Can you now test this flow:
Awaiting your response.
Regards
Strange, normally it's not necessary to reboot the Node Red hardware in case of a change in the flow.Heh, i rebooted nodered machine and it started working, dunno what was wrong, but now when i turn lights on from the actual switch i do get
However, I saw that you changed the picture.
The previous picture showed 4 times the same message, this one shows only 2 messages.
Does this mean that you now receive only 2 messages?
Could have multiple reasons.
1. Do you have MQTT loop activated?
("Prevent loop" setting in MQTT hardware)
2. Which Domoticz version are you running?
Stable version? Or latest beta?
Can you now test this flow:
Code: Select all
[{"id":"191ec999.485656","type":"function","z":"4e92e308.9bb32c","name":"","func":"if (msg.payload.value === 1 )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": 11, \"switchcmd\": \"On\" };\n}\nelse if ( msg.payload.value === 0 )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": 11, \"switchcmd\": \"Off\" };\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1040,"y":100,"wires":[["d805ccf1.c0753"]]},{"id":"d805ccf1.c0753","type":"mqtt out","z":"4e92e308.9bb32c","name":"","topic":"domoticz/in","qos":"1","retain":"false","broker":"f9f13036.e28b58","x":1230,"y":100,"wires":[]},{"id":"f9f13036.e28b58","type":"mqtt-broker","name":"localhost","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Regards
- pgielen
- Posts: 90
- Joined: Monday 18 February 2019 14:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: Boxmeer
- Contact:
Re: Smartthings integration to domoticz
Yes, that is fine. A link to the blog would be appreciated!
Pierre
https://robothuis.nl, RPi4B, RFXCOM XL, Aeotec Z-Stick, ESP Easy, Weatherstation, several switches and sensors, Ikea Trädfri, Philips Hue, Foscam, Reolink, Lyric T6, Ring
-
- Posts: 317
- Joined: Thursday 12 January 2017 15:30
- Target OS: Linux
- Domoticz version: Beta Ch
- Location: Finland
- Contact:
Re: Smartthings integration to domoticz
Yeah, it is working Nice ! Now domoticz and smartthings are synced Thank you very much FireWizard !FireWizard wrote: ↑Thursday 18 March 2021 18:20 Hello @tontze
Strange, normally it's not necessary to reboot the Node Red hardware in case of a change in the flow.Heh, i rebooted nodered machine and it started working, dunno what was wrong, but now when i turn lights on from the actual switch i do get
However, I saw that you changed the picture.
The previous picture showed 4 times the same message, this one shows only 2 messages.
Does this mean that you now receive only 2 messages?
Could have multiple reasons.
1. Do you have MQTT loop activated?
("Prevent loop" setting in MQTT hardware)
2. Which Domoticz version are you running?
Stable version? Or latest beta?
Can you now test this flow:
Awaiting your response.Code: Select all
[{"id":"191ec999.485656","type":"function","z":"4e92e308.9bb32c","name":"","func":"if (msg.payload.value === 1 )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": 11, \"switchcmd\": \"On\" };\n}\nelse if ( msg.payload.value === 0 )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": 11, \"switchcmd\": \"Off\" };\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1040,"y":100,"wires":[["d805ccf1.c0753"]]},{"id":"d805ccf1.c0753","type":"mqtt out","z":"4e92e308.9bb32c","name":"","topic":"domoticz/in","qos":"1","retain":"false","broker":"f9f13036.e28b58","x":1230,"y":100,"wires":[]},{"id":"f9f13036.e28b58","type":"mqtt-broker","name":"localhost","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Regards
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
-
- Posts: 317
- Joined: Thursday 12 January 2017 15:30
- Target OS: Linux
- Domoticz version: Beta Ch
- Location: Finland
- Contact:
Re: Smartthings integration to domoticz
Hello firewizard, im returning here, as im trying to add different kind of sensors now
I havent been able to do so, i dont know how to parse input and how to msg it to mqtt :/ Been following many examples, but i cant get hold of it
Also, smartthings palette separates temp&humidity sensor in to two different nodes, temp and humidity. How do i get these both infused together for one temp&humidity dummy in domoticz ?
These are what i see from those nodes :
Thanks in advance.
I havent been able to do so, i dont know how to parse input and how to msg it to mqtt :/ Been following many examples, but i cant get hold of it
Also, smartthings palette separates temp&humidity sensor in to two different nodes, temp and humidity. How do i get these both infused together for one temp&humidity dummy in domoticz ?
These are what i see from those nodes :
Thanks in advance.
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
- FireWizard
- Posts: 1745
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Smartthings integration to domoticz
Hello @tontze
Okay, let us try and let me explain.
I will put these values in an "Inject" node to simulate your source.
These messages should be merged into one message and therefore we will use a "Join" node.
The upper "Inject" node injects the temperature message in the same format as you provided in your previous post, while the lower "Inject"node does the same, but for humidity. The results, you can see at the very right side in the upper two debug messages.
(I have translated the Finnish "Kitchen" to the "English" Kitchen)
The result of the "Join" action you see in the last message in the Debug pane. As you can see, both are combined in one object.
You see that the result is a command to Domoticz with the svalue, containing your temperature, your humidity and the calculated comfort_level, separated by semicolons.
Do not forget to connect the "MQTT Output" node to the "Function" node.
The configuration of the "Join" node is as follows:
Well, we have to combine two payloads and we create a key/value object. We use the msg.payload.deviceType as the key.
We send our first message out, as soon as we have received 2 messages (preferable both temperature and humidity) and then every message will update the output.
https://www.domoticz.com/wiki/Domoticz_ ... 2Fhumidity
I like also this overview: https://piandmore.wordpress.com/2019/02 ... -domoticz/
I created several examples to send to the various devices in Domoticz in this thread:
viewtopic.php?f=28&t=34300&p=263147&hil ... er#p263147
Have a look of my post December 9, 2020.
The sensor you have chosen (Temperature and Humidity) is a little special in the respect that beside the two values of Temperature and Humidity, a third value (Comfort_ level) is required. Of course it is possible to take "0" as a fixed value, but I have included a function to calculate the value.
The conversion to the required Domoticz format is done in a "Function" node.
The content of the node is as follows:
Do not forget to replace the IDX (1234) with your idx number of the sensor.
The flow looks as follows:
Please find the complete flow below:
I suggest try it and if any questions, I like to hear it.
Regards
Okay, let us try and let me explain.
I see that you receive two different messages from the same device (b03ba40a-2108-43a0-ab16-b52611), but with two different deviceTypes (temperature and humidity), name is less important (kitchen in Finnish, but that is your choice) and of course the values and unit.i don't know how to parse input
I will put these values in an "Inject" node to simulate your source.
It is not really two different nodes, but two different messages.Also, smartthings palette separates temp&humidity sensor in to two different nodes, temp and humidity. How do i get these both infused together for one temp&humidity dummy in domoticz ?
These messages should be merged into one message and therefore we will use a "Join" node.
The upper "Inject" node injects the temperature message in the same format as you provided in your previous post, while the lower "Inject"node does the same, but for humidity. The results, you can see at the very right side in the upper two debug messages.
(I have translated the Finnish "Kitchen" to the "English" Kitchen)
The result of the "Join" action you see in the last message in the Debug pane. As you can see, both are combined in one object.
You see that the result is a command to Domoticz with the svalue, containing your temperature, your humidity and the calculated comfort_level, separated by semicolons.
Do not forget to connect the "MQTT Output" node to the "Function" node.
The configuration of the "Join" node is as follows:
Well, we have to combine two payloads and we create a key/value object. We use the msg.payload.deviceType as the key.
We send our first message out, as soon as we have received 2 messages (preferable both temperature and humidity) and then every message will update the output.
Each sensor in Domoticz requires its own format. You can find these formats in:How do i get these both infused together for one temp&humidity dummy in domoticz?
https://www.domoticz.com/wiki/Domoticz_ ... 2Fhumidity
I like also this overview: https://piandmore.wordpress.com/2019/02 ... -domoticz/
I created several examples to send to the various devices in Domoticz in this thread:
viewtopic.php?f=28&t=34300&p=263147&hil ... er#p263147
Have a look of my post December 9, 2020.
The sensor you have chosen (Temperature and Humidity) is a little special in the respect that beside the two values of Temperature and Humidity, a third value (Comfort_ level) is required. Of course it is possible to take "0" as a fixed value, but I have included a function to calculate the value.
The conversion to the required Domoticz format is done in a "Function" node.
The content of the node is as follows:
Code: Select all
// This function sorts the comfort level for Domoticz based on the humidity.
function comfortlevel(hum) {
switch (true) {
case hum > 70: { hum_stat = 3 } break;
case hum < 30: { hum_stat = 2 } break;
case hum >= 30 && hum <= 45: { hum_stat = 0 } break;
case hum > 45 && hum <= 70: { hum_stat = 1 } break;
default: { hum_stat = 0 } break;
}
return hum_stat;
}
msg.payload = {"command":"udevice", "idx":1234, "svalue":msg.payload.temperature.value + ";" + msg.payload.humidity.value + ";" + comfortlevel(msg.payload.humidity.value)};
return msg;
The flow looks as follows:
Please find the complete flow below:
Code: Select all
[{"id":"e511f64f.4e2bf8","type":"inject","z":"808049fb.fb404","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"deviceId\":\"b03ba40a-2108-43a0-ab16-b52611...\",\"deviceType\": \"temperature\", \"name\": \"Kitchen\",\"value\":24.6,\"unit\": \"C\"}","payloadType":"json","x":530,"y":240,"wires":[["cea81498.5e7d9"]]},{"id":"b2483e9f.d10fe","type":"inject","z":"808049fb.fb404","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"deviceId\":\"b03ba40a-2108-43a0-ab16-b52611...\",\"deviceType\": \"humidity\", \"name\": \"Kitchen\",\"value\":48,\"unit\": \"%\"}","payloadType":"json","x":530,"y":320,"wires":[["cea81498.5e7d9"]]},{"id":"cea81498.5e7d9","type":"join","z":"808049fb.fb404","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"payload.deviceType","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":280,"wires":[["cea3658b.00763"]]},{"id":"cea3658b.00763","type":"function","z":"808049fb.fb404","name":"","func":"// This function sorts the comfort level for Domoticz based on the humidity.\n\nfunction comfortlevel(hum) {\n \nswitch (true) {\n case hum > 70: { hum_stat = 3 } break;\n case hum < 30: { hum_stat = 2 } break;\n case hum >= 30 && hum <= 45: { hum_stat = 0 } break;\n case hum > 45 && hum <= 70: { hum_stat = 1 } break;\n default: { hum_stat = 0 } break;\n}\nreturn hum_stat;\n}\n\nmsg.payload = {\"command\":\"udevice\", \"idx\":1234, \"svalue\":msg.payload.temperature.value + \";\" + msg.payload.humidity.value + \";\" + comfortlevel(msg.payload.humidity.value)};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":860,"y":280,"wires":[["63f49ea5.880bd8"]]},{"id":"63f49ea5.880bd8","type":"debug","z":"808049fb.fb404","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1050,"y":240,"wires":[]},{"id":"87a563e0.3dbde8","type":"mqtt out","z":"808049fb.fb404","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"8591549f.77809","x":1050,"y":280,"wires":[]},{"id":"8591549f.77809","type":"mqtt-broker","name":"Jonas_MQTT_Server","broker":"192.168.10.24","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Regards
- FireWizard
- Posts: 1745
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Smartthings integration to domoticz
Hello @tontze,
And if you connect the MQTT output node, you should see:
Regards
And if you connect the MQTT output node, you should see:
Regards
-
- Posts: 317
- Joined: Thursday 12 January 2017 15:30
- Target OS: Linux
- Domoticz version: Beta Ch
- Location: Finland
- Contact:
Re: Smartthings integration to domoticz
Well, what can i say, it just works Maybe i learn it some day, i have no coding skill at all, so this is hard to understand.
Again, thank you very much !
Again, thank you very much !
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
-
- Posts: 317
- Joined: Thursday 12 January 2017 15:30
- Target OS: Linux
- Domoticz version: Beta Ch
- Location: Finland
- Contact:
Re: Smartthings integration to domoticz
Im a bit puzzled here, why isnt this changing TEMP only dummy in domoticz : ?
I can see in domoticz logs :
?
Code: Select all
[{"id":"9eadc808.4fdfd8","type":"function","z":"e1366dff.7c47f8","name":"","func":"msg.payload = {\"command\":\"udevice\", \"idx\":26, \"nvalue\":0, \"svalue\":msg.payload.value};\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1040,"y":440,"wires":[["b72a581a.148968"]]}]
Code: Select all
2021-03-27 14:54:06.005 MQTT: Topic: domoticz/in, Message: {"command":"udevice","idx":26,"nvalue":0,"svalue":23.3}
2021-03-27 14:54:06.005 Error: MQTT: Invalid data received!
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
- FireWizard
- Posts: 1745
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Smartthings integration to domoticz
Hello @tontze
I have no idea, what you mean with
A few things are important.
1. Where does the data come from.
In my example it came from: msg.payload.temperature.value but in your example it comes from msg.payload.value.
So this is another source.
2. Another thing is also important. svalue requires a string.
Check always that you send a string (between " "). If it is a number (value in blue) add at the end of each value .toString().
3. In your log file, the incoming data message looks not okay. I see at the end 23.3 where I should expect "23.3".
4. It is important that you send the data according to what the configured virtual sensor expects.
In my example the Temperature/Humidity sensor expects 3 parameters. In that case you should send 3 parameters.
If one parameter is not available, send a "0", but send always the number of parameters, as required by the sensor.
I do not know to which sensor you want to send this data, but let's assume it is the temperature sensor.
This sensor expects only the temperature value as a string (1 parameter).
So test the following in the function node:
See picture below:
Do you see the difference regarding the svalue?
The upper one is a number and the lower one a string.
The lower works in Domoticz, the upper one not.
Regards
I have no idea, what you mean with
What I see in your node is the following:Im a bit puzzled here, why isnt this changing TEMP only dummy in domoticz : ?
Code: Select all
msg.payload = {"command":"udevice", "idx":26, "nvalue":0, "svalue":msg.payload.value};
return msg;
1. Where does the data come from.
In my example it came from: msg.payload.temperature.value but in your example it comes from msg.payload.value.
So this is another source.
2. Another thing is also important. svalue requires a string.
Check always that you send a string (between " "). If it is a number (value in blue) add at the end of each value .toString().
3. In your log file, the incoming data message looks not okay. I see at the end 23.3 where I should expect "23.3".
4. It is important that you send the data according to what the configured virtual sensor expects.
In my example the Temperature/Humidity sensor expects 3 parameters. In that case you should send 3 parameters.
If one parameter is not available, send a "0", but send always the number of parameters, as required by the sensor.
I do not know to which sensor you want to send this data, but let's assume it is the temperature sensor.
This sensor expects only the temperature value as a string (1 parameter).
So test the following in the function node:
Code: Select all
msg.payload = {"command":"udevice", "idx":26, "nvalue":0, "svalue":msg.payload.value.toString()};
return msg;
Do you see the difference regarding the svalue?
The upper one is a number and the lower one a string.
The lower works in Domoticz, the upper one not.
Regards
-
- Posts: 317
- Joined: Thursday 12 January 2017 15:30
- Target OS: Linux
- Domoticz version: Beta Ch
- Location: Finland
- Contact:
Re: Smartthings integration to domoticz
I meant, i have TEMPERATURE dummy in domoticz, and was puzzled why it didnt work I do now. I have a steep learning curve here )FireWizard wrote: ↑Saturday 27 March 2021 14:27 Hello @tontze
I have no idea, what you mean with
What I see in your node is the following:Im a bit puzzled here, why isnt this changing TEMP only dummy in domoticz : ?
A few things are important.Code: Select all
msg.payload = {"command":"udevice", "idx":26, "nvalue":0, "svalue":msg.payload.value}; return msg;
1. Where does the data come from.
In my example it came from: msg.payload.temperature.value but in your example it comes from msg.payload.value.
So this is another source.
2. Another thing is also important. svalue requires a string.
Check always that you send a string (between " "). If it is a number (value in blue) add at the end of each value .toString().
3. In your log file, the incoming data message looks not okay. I see at the end 23.3 where I should expect "23.3".
4. It is important that you send the data according to what the configured virtual sensor expects.
In my example the Temperature/Humidity sensor expects 3 parameters. In that case you should send 3 parameters.
If one parameter is not available, send a "0", but send always the number of parameters, as required by the sensor.
I do not know to which sensor you want to send this data, but let's assume it is the temperature sensor.
This sensor expects only the temperature value as a string (1 parameter).
So test the following in the function node:
See picture below:Code: Select all
msg.payload = {"command":"udevice", "idx":26, "nvalue":0, "svalue":msg.payload.value.toString()}; return msg;
Screenshot_temp5.png
Do you see the difference regarding the svalue?
The upper one is a number and the lower one a string.
The lower works in Domoticz, the upper one not.
Regards
-----------------------------------------
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
Smartthings
zigbee2mqtt
RFLink 433mhz / Nrf 2.4Ghz
Mi Light
esp8266MiLight Hub
OpenHab/HomeAssistant/Domoticz
HP T610 & Debian 5.10.19-1 x86_64[/b]
Who is online
Users browsing this forum: Bing [Bot] and 1 guest