Page 1 of 1
General Approach Question - Events/Manual Control
Posted: Wednesday 01 February 2017 9:58
by lake
Hi all, new to domoticz and getting on well so far, so thanks for the great project.
I do however have a question about approach with regard to events/scripts.
Situation:
I have an outside light on a z-wave switch. I can control that switch though domoticz.
I create an event to turn on the outside light between 17:30 and 19:00 (as long as within nighttime window - after sunset)
This all works well.
However I may want to turn the light on after 19:00 manually, or turn the light off between 17:30 and 19:00 manually, and what I find at the moment is the event fights against my manual control of the light (eg. turning the light off again just after I have turned it on).
So the question is what is the preferred approach to cope with situation where event based and manual control is required simultaneously?
Thanks
Ian
Re: General Approach Question - Events/Manual Control
Posted: Wednesday 01 February 2017 16:56
by jvdz
There should be no issue when you turn it on ones at 17:30 and turn it Off ones at 19:00 ... right?
Jos
General Approach Question - Events/Manual Control
Posted: Wednesday 01 February 2017 18:47
by pvm
I did experience the same problem. I have extensive blockly scripts checking for light level, availability of phones, movement, active mediaplayer(s) etc. (With some virtual switches combining these categories). This resulted in the issue you describe.
I created a new virtual switch 'manual mode' to override all automatic scheduling. This with some scene buttons on a tablet.
I wonder whether other users have more simple solutions...
Edit: possibly involving exact times in blockly...
Edit 2: that would not work. It should be possible to automatically switch at every moment during the day
Re: General Approach Question - Events/Manual Control
Posted: Wednesday 01 February 2017 19:48
by StanHD
I have an Auto/Manual switch for each of my Blockly events. That way it's quick and easy to disable and go manual if needed. As I use Amazon Alexa for my overide, then:- "Alexa, turn on the kitchen light" turns off the Auto/Manual switch, disabling the Blockly and turns on the kitchen light for as long as needed. And so on.
Works well for us

Re: General Approach Question - Events/Manual Control
Posted: Thursday 02 February 2017 12:18
by lake
Thanks all for the responses, I get that one can create a dummy "manual over switch" and for 100% digitial control that would work perfectly. However the z-wave device also has a manual on/off toggle. This acts on the device directly, thus would not toggle "manual switch", but rather the actual lights state. Then the scripts end up fighting against it and turning the device on/off against manual will.
There may not be an elegant solution for this but thought I would ask the community before investing a lot of time/ignoring an easy approach.
Thanks
Re: General Approach Question - Events/Manual Control
Posted: Thursday 02 February 2017 12:25
by lake
Just thinking about this some more;
Thought 1 - it would be nice if the reason for last state change was available to the scripts. Then in the scripts the "turn off" script could trigger only if the last state change was caused by another script (rather than detected state change - manual).
- This would need development I think as part of the solution
Thought 2 - The scripts could be updated with logic to only run once in a given day, thus if the "turn on" script has already reached a threshold where the state is changed to on, if the user manually turns off the light, the script will not try and turn it back on again until the next day.
- This could be done using variables I believe.
Just thinking out load...
Re: General Approach Question - Events/Manual Control
Posted: Thursday 02 February 2017 12:46
by jvdz
Isn't your thought 2 the same as doing it what I stated, only one On and one Off action at the beginning/end of the period?
Jos
Re: General Approach Question - Events/Manual Control
Posted: Saturday 04 February 2017 14:14
by markjgabb
Correct me if I'm wrong but doesn't blocky scripts run once per minute as a default?
So for this particular scenario if you used if time = exact time. It would only switch once per day at that time?
Then else if time = later time turn off. The if you switch it between those times it should be manual...I think?
Sent from my SM-G900F using Tapatalk
Re: General Approach Question - Events/Manual Control
Posted: Saturday 04 February 2017 22:20
by EddieT
StanHD wrote:I have an Auto/Manual switch for each of my Blockly events. That way it's quick and easy to disable and go manual if needed. As I use Amazon Alexa for my overide, then:- "Alexa, turn on the kitchen light" turns off the Auto/Manual switch, disabling the Blockly and turns on the kitchen light for as long as needed. And so on.
Works well for us

Can you show a pic of the blocky script please, taken 10 day's of brain melt just to something to work badly, but getting there.
Cheer's
Eddie.
Re: General Approach Question - Events/Manual Control
Posted: Saturday 04 February 2017 22:52
by StanHD
Here you go:-

Re: General Approach Question - Events/Manual Control
Posted: Saturday 04 February 2017 22:59
by StanHD
Looks like this in Floor Plan:-
