select one value to send to domoticz

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
rron
Normal user
Posts: 26
Joined: 13 Mar 2021, 14:33

select one value to send to domoticz

#1 Post by rron » 06 Feb 2025, 11:48

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
Schermafdruk van 2025-02-06 11-42-51.png (13.44 KiB) Viewed 1830 times

User avatar
Ath
Normal user
Posts: 4330
Joined: 10 Jun 2018, 12:06
Location: NL

Re: select one value to send to domoticz

#2 Post by Ath » 06 Feb 2025, 12:02

- 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:

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&param=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)

rron
Normal user
Posts: 26
Joined: 13 Mar 2021, 14:33

Re: select one value to send to domoticz

#3 Post by rron » 06 Feb 2025, 14:51

Thank you ATH,

that works ok. :D

rron
Normal user
Posts: 26
Joined: 13 Mar 2021, 14:33

Re: select one value to send to domoticz

#4 Post by rron » 09 Feb 2025, 16:26

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
Attachments
Schermafdruk van 2025-02-09 16-21-24.png
Schermafdruk van 2025-02-09 16-21-24.png (27.91 KiB) Viewed 1374 times
Schermafdruk van 2025-02-09 16-21-08.png
Schermafdruk van 2025-02-09 16-21-08.png (27.75 KiB) Viewed 1374 times
Schermafdruk van 2025-02-09 16-20-39.png
Schermafdruk van 2025-02-09 16-20-39.png (31.27 KiB) Viewed 1374 times

User avatar
Ath
Normal user
Posts: 4330
Joined: 10 Jun 2018, 12:06
Location: NL

Re: select one value to send to domoticz

#5 Post by Ath » 09 Feb 2025, 17:09

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:

Code: Select all

On S0#W Do
  SendToHTTP,192.168.178.50,8080,/json.htm?type=command&param=udevice&idx=919&svalue=%eventvalue1%
Endon

On S0#kWh Do
  SendToHTTP,192.168.178.50,8080,/json.htm?type=command&param=udevice&idx=920&svalue=%eventvalue1%
Endon
(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:

Code: Select all

On S0#All Do
  SendToHTTP,192.168.178.50,8080,/json.htm?type=command&param=udevice&idx=919&svalue=%eventvalue1%
  SendToHTTP,192.168.178.50,8080,/json.htm?type=command&param=udevice&idx=920&svalue=%eventvalue2%
Endon
- Now handles S0#All event
- The first argument (%eventvalue1%) has the first value (W), the second argument (%eventvalue2%) has the second value (kWh), etc.
/Ton (PayPal.me)

rron
Normal user
Posts: 26
Joined: 13 Mar 2021, 14:33

Re: select one value to send to domoticz

#6 Post by rron » 09 Feb 2025, 18:01

Thank you for your help. I let you know if it works.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 15 guests