I have a more general question how to solve a problem best.
I want my light in the home to be controlled automatically. Today I use cron and astro total radiation to control when to turn light on and off. It is working fairly well.
The problem I want to solve is to be able to use my standard Aeotec Nano Dimmers switches to temporarily increase light when cooking food, or temp disable when watching tv. And so on, scenes.
My problems are:
The dimmers I can not find scene control on. I can get them to send a basic set when pressed. However that becomes a Dimmer Item value change, same as i will get when the dimmer is automatically set. So I would like to be able to catch the explicit basic set. Or of course if there are any smarter solutions.
After changing the light it will be changed back as soon as an automated change is triggered. Is there some smart way to temporarily disable automated tasks for some light sources?
My normal way of doing this would be with some generic functions and so. But I do understand that rules are better not written that way.
So, any thoughts and pointers in the right direction are appreciated. Both of course around how to more efficiently use the Nano Dimmers and the rule structure itself.
See Design Pattern: Manual Trigger Detection. What you need to do is determine whether a change to your Dimmer is caused by OH automation or manually from the device itself. That’s what the DP shows you how to do. Then it’s just a simple matter of setting and checking flags which can either be global variables or Items.
Finally got around to start working on this.
Apparently there is something I am failing to understand when it comes to groups.
In a rule where I have a “Member of gIndoorLight” trigger the group exists and work.
When I try to do gIndoorLight.members.forEach in a cron triggered rule it cannot be found and I get an error saying “The name ‘gIndoorLight’ cannot be resolved to an item or type”.
What am I missing here?
Just to eliminate one error that crops up for some users, restart OH. Sometimes, especially immediately after an update, OH fails to recognize a bunch of Items until the next restart. It seems unlikely that that is the case but we can easily rule it out with a restart.
Watch openhab.log for any errors and report them here.
I don’t see anything obviously wrong with the Rule, assuming your “Updated” Rule actually triggers and runs.
This is when automatic is run, no relevant warnings before this:
2019-12-11 21:20:06.842 [WARN ] [eclipse.smarthome.model.script.light] - System started
2019-12-11 21:20:07.625 [WARN] [eclipse.smarthome.model.script.light] - Automatic executed
2019-12-11 21:20:07.627 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Automatic': The name 'gIndoorLight' cannot be resolved to an item or type; line 36, column 2, length 12
2019-12-11 21:38:43.231 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'indoor_light.rules', using it anyway:
There is no context to infer the closure's argument types from. Consider typing the arguments or put the closures into a typed context.