Page 1 of 1

Easily change a user variable

Posted: Sunday 07 June 2020 1:28
by Mainow
I have just managed to set up a Switch to control an external relay. The relay is not supported by Domoticz, so I use a switch or a scene to call a script, which turns the relay on and off.
So far so good.
But now want to start and stop it at specific times. I created user variables start time and stop time to be able to activate the scene with Blockly. That works nicely, but I would like to be able to modify the start time and stop time easily.
Now I have to go into setup - more options - user variables to get to the start and stop times.
I would like to have them on my dashboard, so I can modify them from there, or ideally have a start time and duration on my dashboard, so that if i change start time or duration, the stop time is modified along with it.

Re: Easily change a user variable

Posted: Sunday 07 June 2020 9:17
by MikeF
Mainow wrote: Sunday 07 June 2020 1:28 I have just managed to set up a Switch to control an external relay. The relay is not supported by Domoticz, so I use a switch or a scene to call a script, which turns the relay on and off.
So far so good.
But now want to start and stop it at specific times. I created user variables start time and stop time to be able to activate the scene with Blockly. That works nicely, but I would like to be able to modify the start time and stop time easily.
Now I have to go into setup - more options - user variables to get to the start and stop times.
I would like to have them on my dashboard, so I can modify them from there, or ideally have a start time and duration on my dashboard, so that if i change start time or duration, the stop time is modified along with it.
Why not just set a timer? Click on the Timers button for that device in the Switches tab, and you can change the start and stop times there.

Re: Easily change a user variable

Posted: Thursday 18 June 2020 23:50
by Mainow
Hi MikeF
Yes, that could work, but I want to be able to make my timer conditional on a dummy switch.
The plan is this: I have a garden sprinkler which I want to sprinkle the grass once a day. I'm not entirely sure about the time and duration yet.
But of course it would be silly to have it go off if it's rainy weather and the grass will be wet anyways.
So I set up a dummy switch which controls whether the sprinkler will go today. I set it up in Blockly, and that works, but it's rather time consuming to have to go into the user variables menu to change the start and stop time.
Ideally, I'd like to have a start time and a duration, so that I can start at time x and stop at time x+y, but I haven't managed to get Blockly to do that either.

Re: Easily change a user variable

Posted: Friday 19 June 2020 7:21
by EddyG
Could not you use a selector switch with a few presets?

Re: Easily change a user variable

Posted: Monday 22 June 2020 22:24
by Mainow
I suppose that could work.
You mean like a radio button with multiple options? Is that possible?
All I found so far is a dummy on/off switch.