Send timer value to Domoticz?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Send timer value to Domoticz?

#1 Post by manjh » 16 Jul 2018, 17:08

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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Send timer value to Domoticz?

#2 Post by grovkillen » 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?
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 :idea: :idea: :idea:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Send timer value to Domoticz?

#3 Post by manjh » 16 Jul 2018, 17:50

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?
Good to hear that it is not a problem.
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? :shock:

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Send timer value to Domoticz?

#4 Post by grovkillen » 16 Jul 2018, 18:39

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

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Send timer value to Domoticz?

#5 Post by manjh » 16 Jul 2018, 21:45

grovkillen wrote: 16 Jul 2018, 18:39 Go to the rules tutorial page. Link on first page.
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?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Send timer value to Domoticz?

#6 Post by grovkillen » 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..
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 :idea: :idea: :idea:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Send timer value to Domoticz?

#7 Post by manjh » 16 Jul 2018, 23:59

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..
Understand. but I don't see how this would achieve my goal: transfer the actual remaining time to Domoticz.
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?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Send timer value to Domoticz?

#8 Post by grovkillen » 17 Jul 2018, 05:51

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

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: Send timer value to Domoticz?

#9 Post by kimot » 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&param=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

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Send timer value to Domoticz?

#10 Post by manjh » 26 Jul 2018, 00:29

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&param=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
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
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: Send timer value to Domoticz?

#11 Post by kimot » 31 Jul 2018, 14:08

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&param=switchlight&idx=26&switchcmd=On
SendToHTTP 192.168.1.253,8080,/json.htm?type=command&param=udevice&idx=28&nvalue=0&svalue=660;0

For temperature in variable:

SendToHTTP,192.168.178.14,8084,/json.htm?type=command&param=udevice&idx=385&nvalue=0&svalue=[DSB18B20#Temperature]

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests