This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Comments
When you're not aware that the time stamp doesn't change in that scenario, you could conclude that the first step (populate the variable) didn't work, therefore the second trigger also didn't do anything, etc.
So in summary, the variable was set, but to the same value, so the time stamp was NOT changed. I now know to use a boolean flip for debugging. Those always change
For this a generic list would come in handy.
Triggers
- Item added/removed (is duplicate)
Conditions
- list (not) contains
Actions
- add/remove (duplicate) item (string, number)
Is there any way we can record the time a device has been on (for the last x hours/days) without sensors, but just by keeping state? In the future I would like to be able to make decisions based on this information. Or even with sensors perhaps... Bear in mind that a delay card would not help here, as it might be the device has been on 5x for 2 hours during the past 24 hours. I want to be able to use the fact that a device has been on for 10 hours in the past 24 hours in a decision (and condition).
For example, of my pool pump hasn't been running for more than 4 hours during the day, I want it to run at night until 4 hours is reached... This could be based on an on/off socket by keeping state, or a flow sensor detecting flow...
It seems like logic building blocks and therefore i thought it might be a fit.
so if slider is <=25% set 1
if >25 and <=50 set 2
if >50 and <=75 set 4 enz.
so that i don't need 4 controllers on my homey or is it possible to make one controller with multiple states?
Can you explain how you envision this?
Also, how can I use a variable token from the When column in the Then part, when the variable hasn't changed?
Edit: doH! https://github.com/PatrickSannes/BetterLogic
This will be an advanced card with no syntax checking. Variables can be inserted with $ signs prefixed. The string will be searched for all $ variables and then they will be replaced. What do you think?
- Make all triggers also when the variable is not changed, but when it is set.
- Make an extra trigger card that triggers always (even if it is not changed)
Idea behind this is that it would simplify the motion sensor flows
Flow 1: when motion detected and luminance < xx lux then $time_motion = time + $time_offset + switch lights on
Flow 2: when time >= $time_motion then switch lights off
Flow 1: when motion detected and luminance < xx lux then ($time_motion = time + $time_offset )+ switch lights on
Flow 2: when $time changed and $time > $time_motion and lights on then switch lights off
Flow 3: Every X seconds then $time = current time
The advanced setting card will be made with mathjs.org. Ill introduce a special variable to add a time variable to it. So you get a card that has 2 inputs:
Mathjsfunction: $timenow$ + 1800 (now + half an hour)
Output variable: time_motion
For overview purposes, these are the release notes of the version now pushed.