Send timer value to Domoticz?
Moderators: grovkillen, Stuntteam, TD-er
Send timer value to Domoticz?
In some of my ESP's I make use of timers, which I would like to see in Domoticz.
Is there a way to send the value over to the Domoticz server on a regular basis? May every minute, or every 10 seconds?
Even better would be if I could do it from the rules, that way I can use a dedicated timer to set the interval myself....
Is there a way to send the value over to the Domoticz server on a regular basis? May every minute, or every 10 seconds?
Even better would be if I could do it from the rules, that way I can use a dedicated timer to set the interval myself....
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Send timer value to Domoticz?
Yes, no problem. Especially easy if you use MQTT. But works just fine over HTTP. Have you studied the wiki?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Send timer value to Domoticz?
Good to hear that it is not a problem.grovkillen wrote: ↑16 Jul 2018, 17:28 Yes, no problem. Especially easy if you use MQTT. But works just fine over HTTP. Have you studied the wiki?
Yes, I did look at the Wiki, but as usual the level of success depends on using the right search words.
Searching with "rules timer" did not give me any leads.
Can you give me a hint?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Send timer value to Domoticz?
Go to the rules tutorial page. Link on first page.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Send timer value to Domoticz?
Many links on that page. I tried them, can't find anything that looks like it will work for me.
I also read through the command reference, the command that looks like it may be useful is Publish.
But then in the System Variables page, I don't see a sysvar that contains the actual remaining time of a timer.
Am I missing something?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Send timer value to Domoticz?
You would need to use a dummy variable that you pass the wanted timer in seconds. Then the timer will subtract one integer for each passing second until the timer reaches zero and then it's either disabled/inactivated or start over with the count down.
So essentially the timer is one second long and then repeated the wanted number of seconds. Might need two timers..
So essentially the timer is one second long and then repeated the wanted number of seconds. Might need two timers..
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Send timer value to Domoticz?
Understand. but I don't see how this would achieve my goal: transfer the actual remaining time to Domoticz.grovkillen wrote: ↑16 Jul 2018, 22:47 You would need to use a dummy variable that you pass the wanted timer in seconds. Then the timer will subtract one integer for each passing second until the timer reaches zero and then it's either disabled/inactivated or start over with the count down.
So essentially the timer is one second long and then repeated the wanted number of seconds. Might need two timers..
So when a timer starts, I could use a second timer to report progress every (say) 60 seconds.
That part is clear.
But now the actual execution: how do I send a message to Domoticz with the remaining number of seconds of a timer?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Send timer value to Domoticz?
That would also be a rule that do the report either once a minute or on every update of the dummy.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Send timer value to Domoticz?
Create for example user variable in Domoticz and send timer value in it.
Then you can using this value by LUA or Blockly.
/json.htm?type=command¶m=updateuservariable&vname=USERVARIABLENAME&vtype=USERVARIABLETYPE
&vvalue=USERVARIABLEVALUE
Remember to change:
USERVARIABLENAME with the name of your variable
USERVARIABLETYPE according to the table from "Store a new variable"
USERVARIABLEVALUE with the new value
https://www.domoticz.com/wiki/Domoticz_ ... _variables
Then you can using this value by LUA or Blockly.
/json.htm?type=command¶m=updateuservariable&vname=USERVARIABLENAME&vtype=USERVARIABLETYPE
&vvalue=USERVARIABLEVALUE
Remember to change:
USERVARIABLENAME with the name of your variable
USERVARIABLETYPE according to the table from "Store a new variable"
USERVARIABLEVALUE with the new value
https://www.domoticz.com/wiki/Domoticz_ ... _variables
Re: Send timer value to Domoticz?
OK, this is the Domoticz side. But what is the statement for the rules that actually takes the timer value and sends it into Domoticz?kimot wrote: ↑25 Jul 2018, 23:11 Create for example user variable in Domoticz and send timer value in it.
Then you can using this value by LUA or Blockly.
/json.htm?type=command¶m=updateuservariable&vname=USERVARIABLENAME&vtype=USERVARIABLETYPE
&vvalue=USERVARIABLEVALUE
Remember to change:
USERVARIABLENAME with the name of your variable
USERVARIABLETYPE according to the table from "Store a new variable"
USERVARIABLEVALUE with the new value
https://www.domoticz.com/wiki/Domoticz_ ... _variables
Re: Send timer value to Domoticz?
Create Timer like dummy device in ESPeasy and
use command SendToHTTP in rules with JSON format for Domoticz.
Example for switch and Power sending:
SendToHTTP 192.168.1.253,8080,/json.htm?type=command¶m=switchlight&idx=26&switchcmd=On
SendToHTTP 192.168.1.253,8080,/json.htm?type=command¶m=udevice&idx=28&nvalue=0&svalue=660;0
For temperature in variable:
SendToHTTP,192.168.178.14,8084,/json.htm?type=command¶m=udevice&idx=385&nvalue=0&svalue=[DSB18B20#Temperature]
use command SendToHTTP in rules with JSON format for Domoticz.
Example for switch and Power sending:
SendToHTTP 192.168.1.253,8080,/json.htm?type=command¶m=switchlight&idx=26&switchcmd=On
SendToHTTP 192.168.1.253,8080,/json.htm?type=command¶m=udevice&idx=28&nvalue=0&svalue=660;0
For temperature in variable:
SendToHTTP,192.168.178.14,8084,/json.htm?type=command¶m=udevice&idx=385&nvalue=0&svalue=[DSB18B20#Temperature]
Who is online
Users browsing this forum: No registered users and 38 guests