I started out wanting to store values in Influx and my driver has evolved but I can't get it to work.
I want to take a device attribute (or even a device state) and use its value as a value in a rule.
Basically, I take a get from sunrise-sunset.org and store the twilight begin and ends values to an attribute.
In Rules, I want to run a daily scheduled rule that pulls my values and set porch lights to go on and off using these values.
Rules seems to only use Epoch but won't pull from a device attribute as far as I can tell. So I tried to write the attribute to global variables.
I read that you can store attributes into global variables with a rule but can't see how to accomplish that. Guidance? info on how to do it in my driver? thanks!
I know this doesn't address your question but your use case seems overly complex. I looked at sunrise-sunset.org for my area and twilight is mostly 25 minutes after sunset so wouldn't it be easier to set your rules to fire +25 minutes after sunset?
There is also a 'epoch' time option which i've been working at. I can form the variable correctly as milis from 1970, but cant' quite get it to write back into a hub variable. I might have to use a connector maybe?
I would suggest in your driver create a custom attribute that you change to a value. Then on a daily basis pull the times you need then when you do thay pull have the driver schedule a job to change the custom attibute to a value. That will give you a event to look for. Then just use RM to trigger off that atteibute change.