Hello, looking for some assistance. The below piston is for my fans. It works great, but I dont’ know how to override the piston by the switch. Right now if the piston turns the fan on and I use any switch to turn it off the fan turns right back on. I want the piston to do both automation and manual. So any ideas would be awesome.
can someone with programming knowledge show me how to display this in red on my dashboard so i can see it more easily on my dashboard?
{$currentEventDevice} is {$currentEventValue} at {$currentEventDate}
Thanks!
[red| {$currentEventDevice} is {$currentEventValue} at {$currentEventDate}]
For reference, from the dev himself:
Format is [ class | text ]
class is one of:
b >>> bold text
i >>> italic text
u >>> underlined text
s >>> strikethrough
#XXXXXX >>> rgb color
(color name) >>> that css color name
you can combine classes by separating them with a space or comma:
[ b,u,red | this should be bold, underline, and red]
There is a
pre
too… missed that lol
When did you sneak that in??
All seems to work on this piston except the if condition at line #36 is only becoming true when the motion detector becomes active after staying inactive for some time and not when the motion detector stays inactive for 45 mins. I even changed the event subscription to always subscribe for line #37, but that does not help.
What am I doing wrong?
Thanks!
Greetings once again,
I’m trying to figure why my maths are not working.
All I’m trying to do is find the difference of one temp sensor to another. If there’s a 1c difference (for testing), turn on a fan.
Temp sensor 1 is reading 22.50000
Temp sensor 2 is reading 21.50000
The math for tempDifference is supposed to be 22.50000-21.50000, which should be 1, but it’s 22!
Perhaps I’m going about the math wrong?
Cheers.
5/26/2017, 10:10:14 PM +750ms
+1ms ╔Received event [My House].test = 1495851014743 with a delay of 7ms
+213ms ║RunTime Analysis CS > 25ms > PS > 130ms > PE > 57ms > CE
+223ms ║Runtime (32680 bytes) successfully initialized in 130ms (v0.1.0b1.20170524) (221ms)
+224ms ║╔Execution stage started
+243ms ║║Comparison off is off = true (3ms)
+245ms ║║Condition #4 evaluated true (13ms)
+588ms ║║Comparison 22.5 is_greater_than 1 = true (5ms)
+590ms ║║Condition #5 evaluated true (344ms)
+591ms ║║Condition group #1 evaluated true (state did not change) (360ms)
+595ms ║║Cancelling statement #2’s schedules…
+624ms ║║Calculating (string) Room is < + (string) 22.500000 >> (string) Room is <22.500000
+631ms ║║Calculating (string) Room is <22.500000 + (string) > < >> (string) Room is <22.500000> <
+663ms ║║Calculating (string) Room is <22.500000> < + (string) 21.500000 >> (string) Room is <22.500000> <21.500000
+669ms ║║Calculating (string) Room is <22.500000> <21.500000 + (string) > >> (string) Room is <22.500000> <21.500000>
+675ms ║║Calculating (string) Room is <22.500000> <21.500000> + (string) 22.500000 >> (string) Room is <22.500000> <21.500000> 22.500000
+680ms ║║Calculating (string) Room is <22.500000> <21.500000> 22.500000 + (string) c hotter than main floor. >> (string) Room is <22.500000> <21.500000> 22.500000c hotter than main floor.
+710ms ║║Executed virtual command sendPushNotification (23ms)
+721ms ║║Comparison :e92c72033c49ee84587301b0bb933d41: is :a33e10574ebe45d1148e6b694bcd05e4: = false (4ms)
+723ms ║║Condition #9 evaluated false (9ms)
+724ms ║║Condition group #6 evaluated false (state did not change) (10ms)
+804ms ║╚Execution stage complete. (579ms)
+946ms ╚Event processed successfully (946ms)
I’d suggest to enclose the device expression in decimal(), it looks it’s a string output based on the log.
decimal([device:temperature])
Your sensor has a : in the name? I think I am looking for the last : in the [ ] construct, but that may have a little to do with it there. Got any other sensor without a : in the name to test and see if the value is correct?
Ya… quite a few of my sensors have a “:” to help categorize them. It seems to work fine with my other pistons.
Like this one…
Works great too.
Your suggestion seems to have worked.
It now returns a number of 0.300000 (which is now 22.300000 - 22.000000 at the time of this test)
If I may ask, is there something I can put in the equation (while the variable is being assigned) to decrease the decimal points to ##.# ?
Also… is it technically OK to have a variable be initially assigned an expression before the first IF statement?
Thanks in advance.
You can try round() in the expression. There is a list of functions in the wiki also that has examples that are pretty handy.
Edit: Regarding your variable question, yes it is, actually @ady624 pointed out that the initial variable value can be assigned using an expression and save one task line.
What am I doing wrong?
I have a pantry overhead light, and I also have LED strips under the shelves.
The overhead light is called "pantry lights "
The undershelf lighting is called "pantry shelving quote
I have a door sensor on the pantry as well.
What I want:
Anytime pantry door opens, turn on pantry lights and pantry shelving
Anytime pantry door closes, turn off pantry lights and pantry shelving
Anytime pantry lights turned off (physical switch, Alexa, ST app), turn on pantry shelving
Anytime pantry lights turned off (physical switch, Alexa, ST app), turn on pantry shelving
Anytime pantry lights left on greater than 15 minutes, turn off pantry light in pantry shelving
Here’s what I did. Only the turning on with door open or switch work. The off triggers don’t seem to be doing anything
I have a room with a door sensor and want my LIFX light to blink when someone opens the door from the outside and is entering the room (as opposed to someone opening the door from the inside who is leaving the room). The logic I would like is the following:
IF…
A) the door to the room is opened, AND
B) the door had been shut for 10 to 235 minutes, AND
C) the motion detector in the hallway leading to the room saw motion within the past 1 minute
THEN…
Trigger IFTTT Maker to call a IFTTT event that blinks the LIFX light (the LIFX IFTTT blink action works exactly how I want).
Side notes to explain the scenario in case it helps with your analysis:
-
The door automatically closes, so it is only open when someone is actively entering or exiting, otherwise it is closed.
-
The idea point item C is that if the door opens, but there was no motion outside the room, then I can basically assume the door is opening because someone is leaving the room, since the motion detector would have tripped if someone was approaching the room from the outside and entering. This way the light only blinks if someone is entering and not from someone opening the door to leave.
-
The idea behind point B is that if the room is fairly active with people coming and going then the door will not have been shut for more than 10 minutes at a time, and during such busy activity I do not want the light to blink as people actively enter the room. Once everyone settles in and things quiet down (aka door has been closed for more than 10 minutes) that’s when I want the blinking to occur when someone else enters. And the 235 minute limit is because after 235 minutes of the door not having been opened, I can assume that no one is in the room at that point, and this will prevent the light from blinking the first time the room is entered which would be a little annoying.
Can someone please explain the best way to accomplish this in WebCore?
Thank you!!
Which actions/commands do you guys use with Hue lights to:
(a) turn them On/Off;
(b) Set Brightness level;
© Set Color;
(d) Fade them up or down?
webCore has the following (dedicated) Hue actions:
I’m not sure what “Adjust Hue”; “Set hue” and “setHueUsing100(…)” is used for and how to use them.
I have been trying all possible commands and can never get them to turn on to the correct brightness and colour. That is if they do turn on at all.
I have 14 Hue devices in my Bar (colour lights; strips and one Bloom) and I have for the past 2 hours been trying out different settings to get them to reliably turn on/of - not once did all they all turn on or off - sometimes as many as 4 are left on when turning them off.
I’m starting to think that it is simply not possible to reliably control the Hue lights and will appreciate some guidance and general principles on how you guys set up piston for Hue lights immensely.
Thanks Robin! Although I’m familiar with CoRE this is my first foray into WebCore. A few questions please:
-
In your snippet, what’s the difference between “contact sensor 5” and “front door”? I would think both would be the same device, so I’m a little confused why they have different names/references there?
-
Great to see that WebCore can talk directly to the LIFX bulb and I don’t need IFTTT for that. Is there a way to tell it what color to flash it and at what brightness level? For instance with IFTTT I can say to flash the bulb 2 times with color Blue at 70% brightness. And if the bulbs are on and green and at 20%, for instance, it’ll flash them blue at 70% twice and then put it back to green at 20%. Or if the bulbs are off, it’ll still flash it blue at 70% and then turn them back off after the flash. If WebCore cannot do the same, then I suppose it’ll be best for me to have it make a call to IFTTT Maker and let IFTTT handle the flash?
-
Is there a way to specify the thresholds like the 60000 and 600000 in minutes instead of milliseconds? Just a little bit easier to read and maintain that way and the precision of a “minute” is good enough in this case.
Thanks!
Is it possible to specify a list of devices and then choose from the list based upon a variable index number, i.e something like
List dev1, dev2, dev3, dev4
DevToUse = List (Index)
Using DevToUse Turn On
If Index is 2, then dev2 would turn on.
Any ideas? Thanks!
Giving a use case will give us an idea of what you are trying to accomplish. Might not be down the path you are thinking but we might know another way to get there.