select one value to send to domoticz
Moderators: grovkillen, Stuntteam, TD-er
select one value to send to domoticz
Is there a way to select only one value to send to domoticz? My device generates 3 values and I only need one namely total.
- Attachments
-
- Schermafdruk van 2025-02-06 11-42-51.png (13.44 KiB) Viewed 1830 times
Re: select one value to send to domoticz
- Uncheck the Controller checkbox for Domoticz
- If you have task setting "Single event with all values" unchecked, you can respond to the S0#Total event:
- If you have task setting "Single event with all values" unchecked, you can respond to the S0#Total event:
Code: Select all
on S0#Total do
// When using Domoticz HTTP: (Adjust Domoticz IP address, Port and idx values)
SendToHTTP 192.168.1.2,8080,/json.htm?type=command¶m=udevice&idx=123456&nvalue=0&svalue=%eventvalue1%
// When using Domoticz MQTT: (adjust idx to the desired value)
Publish domoticz/in,'{"idx":123456,"nvalue":0,"svalue":"[%eventvalue1%]"}'
endon
/Ton (PayPal.me)
Re: select one value to send to domoticz
Thank you ATH,
that works ok.
that works ok.

Re: select one value to send to domoticz
After the first part that was oke, I am trying to send W and kWh to domoticz. This is what i have made. The problem is I think the formula. My S0 counter generates 2000 p/kW. The W only doesn't work for me.
I searched the forum and I saw a remark that was a problem in the previous software. I am now on 20241221
I searched the forum and I saw a remark that was a problem in the previous software. I am now on 20241221
- Attachments
-
- Schermafdruk van 2025-02-09 16-21-24.png (27.91 KiB) Viewed 1374 times
-
- Schermafdruk van 2025-02-09 16-21-08.png (27.75 KiB) Viewed 1374 times
-
- Schermafdruk van 2025-02-09 16-20-39.png (31.27 KiB) Viewed 1374 times
Re: select one value to send to domoticz
It seems you are trying to send 2 values to a single field in Domoticz. a) That won't work, and b) Your syntax is wrong
You can use a separate event handler for each value:
(Please use code blocks (</> button) when showing your rules instead of a screenshot)
- I guessed that your kWh sensor idx could be 920, but you may need to adjust that.
- Better use %eventvalue1% to use the value that's taken at the exact moment of the event.
If you want your values to be taken at the exact same time, change the plugin setting to have the "Single event with all values:" checkbox to be enabled, and use this rule:
- Now handles S0#All event
- The first argument (%eventvalue1%) has the first value (W), the second argument (%eventvalue2%) has the second value (kWh), etc.
You can use a separate event handler for each value:
Code: Select all
On S0#W Do
SendToHTTP,192.168.178.50,8080,/json.htm?type=command¶m=udevice&idx=919&svalue=%eventvalue1%
Endon
On S0#kWh Do
SendToHTTP,192.168.178.50,8080,/json.htm?type=command¶m=udevice&idx=920&svalue=%eventvalue1%
Endon
- I guessed that your kWh sensor idx could be 920, but you may need to adjust that.
- Better use %eventvalue1% to use the value that's taken at the exact moment of the event.
If you want your values to be taken at the exact same time, change the plugin setting to have the "Single event with all values:" checkbox to be enabled, and use this rule:
Code: Select all
On S0#All Do
SendToHTTP,192.168.178.50,8080,/json.htm?type=command¶m=udevice&idx=919&svalue=%eventvalue1%
SendToHTTP,192.168.178.50,8080,/json.htm?type=command¶m=udevice&idx=920&svalue=%eventvalue2%
Endon
- The first argument (%eventvalue1%) has the first value (W), the second argument (%eventvalue2%) has the second value (kWh), etc.
/Ton (PayPal.me)
Re: select one value to send to domoticz
Thank you for your help. I let you know if it works.
Who is online
Users browsing this forum: Ahrefs [Bot] and 15 guests