bamarayne
(Jason "The Enabler" as deemed so by @Smart)
1
Welcome to the CoRE Logic Thread. Here you will find many community members that are more than willing to help you with the Logic and Programming of your Pistons.
**There will be another thread for “How are you using CoRE?” and “How are you using the CoRE/AskAlexa integration?”.
So, this is the place to ask your questions and the place to get the answers.
Hi,
First, thank you for everything you doing for this community!
I’m trying to see I can count the number of toggles form a specific switch with in a specific time.
something like -
IF
Switch is toggle
and then
Switch is toggled again within 2 sec
and then
Switch is toggled again within 2 sec
THEN
do something
I know I need to use the variables in some way, but I can’t understand how…
I did try to set a $second variable, but I don’t now how to use it…
Can you please give me some directions on where to start?
Gil
bamarayne
(Jason "The Enabler" as deemed so by @Smart)
5
I found that the power meter like to fluctuate on the reading, so when I was using the conditions “is greater than” or “is within range” the piston would evaluate every time the power reading changed.
I had to go with triggers to get it to behave.
Changes to, raises above, enters range - these triggers worked well, I just had to excitement and find the best one for my use case.
I actually used “raises above” to initiate the piston and then “enters range” turn it off.
2 Likes
bamarayne
(Jason "The Enabler" as deemed so by @Smart)
6
I’ve been working on this as well, but I think there is still a bug.
I’m using a latching piston that captures the state of my bulbs when a switch turns on. It then restores them when the switch is turned off.
It does everything as programmed, but it does not restore the lights back. It is setting the levels properly, just not the colors.
bamarayne
(Jason "The Enabler" as deemed so by @Smart)
7
Hi Gil! !
Take a look at this piston and see if you can modify it to work for you.
This piston counts the number of times the dog food container has been opened, sends a message when it reaches 3 times it more, and resets the counter at midnight.
****note - not positive the counter reset is working. I have this one as an example I helped someone else with and I don’t actually use it.
Jason, a lot of the attributes you selected override each other. colorTemperature for example affects hue and saturation. Try using only hue, saturation and level. Those three fully describe the color. Or try color alone, though I noticed that uses RGB.
bamarayne
(Jason "The Enabler" as deemed so by @Smart)
10
I’ll try that and let you know. Fyi - This is using Phillips hue color bulbs
I can’t find a combination of the attributes that makes this work…
Not sure what’s up.
I do know when Bruce was setting this up in RM it would act differently with different brands of lights… I’m not sure what he had to do to get it to work.
Maybe there should be a dedicated capture and restore just for bulbs?
I just posted about this in the original thread, I thought it was similar to what you saw but for some reason didn’t connect the dots. Seems to me this shouldn’t be an issue with historical conditions vs current conditions. Like CoRE is evaluating the conditions as “did it change” followed by “is it in bounds” instead of the historical “did this go over/under in time specified.” Will try my other rule with trigger instead, thank you!
This was for me I added it but couldn’t get it to work. My biggest problem in troubleshooting - how do I check the value of the variable? I can’t find anywhere to read the value, thus can’t tell why it’s not firing the audio. I can tell in notifications that upon the container changing to open, the piston fires, but that is all.