Custom value for timer

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
MSsleeper
New user
Posts: 2
Joined: 15 Feb 2019, 22:23

Custom value for timer

#1 Post by MSsleeper » 15 Feb 2019, 22:32

Hello all,
I am building a garden irrigation project for my home assistant implementation. I would like to be able to send values from HA via MQTT and change the duration of espeasy timer. I have MQTT import device up and working. Is it possible to pass the value from my MQTT import to the timer function? I have tried this

Code: Select all

on System#Boot do
gpio,2,1 // Prevent relay turning on during boot
endon

on valve#Switch=0 do
  timerSet,1,watertime#duration	 // turn on water valve
endon

on Rules#Timer=1 do
  gpio,2,1 // Turn off relay
endon
Where watertime is the name of the device and duration is the value. Thanks for any guidance!

MSsleeper
New user
Posts: 2
Joined: 15 Feb 2019, 22:23

Re: Custom value for timer

#2 Post by MSsleeper » 16 Feb 2019, 01:39

Figured it out

Code: Select all

on System#Boot do
gpio,2,1 // Prevent relay turning on during boot
endon

on valve#Switch=0 do
  timerSet,1,[watertime#duration]	 // duration
endon

on Rules#Timer=1 do
  gpio,2,1 // Turn off relay
endon

Post Reply

Who is online

Users browsing this forum: No registered users and 64 guests