Guidance on device status


#1

Looking for help from the forum on a few devices and how to use their attributes. These are not specifically related, but just asking about them all in 1 post:

  1. I want to write a piston to turn off a gas heater if the SHM is in alarm state. To be clear, I do not mean armed, I mean it has been tripped. If you drop SHM monitor into a piston, all you get as webcore standard Compare options are Disarmed, Armed/Stay and Armed/Away. Can someone provide how I would use alarm tripped and alarm tripped as conditions in piston.

These other questions are similar in nature.

  1. I have a Halo smoke detector, same as above, how can I write it into a piston for ‘if tripped’? I also want to turn off gas heater if Halo is tripped.

  2. I have an outside weather device that gets a lot of data - Ambient Weather Station. I want to say if wind is greater than x. As a device in webcore only illuminance, temp and one other show up with selectable conditions. Wind and wind_gust are in the list but nothing is prepackaged in the Compare line when adding the device.

Finally a little different
4) I am trying to build a tile piston that works for both switches and contact sensors. Is there a straight forward way to determine if the device is either on (switch) or open (contact)? I tried something like “([Component : switch] == ‘on’ ? ‘true’ : ([Component : contact] == ‘open’ ? ‘true’ : ‘false’) : false))” as a variable in the tile, but it did not work. *note I just scratched out that code just now, it’s not copy/paste, so it might have bad syntax.


#2

Have you tried using $shmTripped as the trigger? I have not tested it myself as I don’t use SHM

For #3, my guess is your data is coming in as a string so I would suggest integer([device:wind_gust]) to make the other comparison options available to your statement.

Edit: On second thought, I’m not sure if you can subscribe to a local variable. Hmm, something to test.


#3

Thanks, I think part of what I am just not sure on is the syntax or how to use these variables.

For the $shmTripped, would it be:


#4

I guess what is odd to me in that syntax, is are we simply assuming @shmTripped = True. so my comparison statement of ‘is not’ means is false? Does that make sense? I am sure I was not clear.


#5

Oh, this is more of what I was thinking but not sure it will trigger without actually setting up SHM


#6

Ah, I think that is logic I think I was missing. I was mentally stuck on loading the device first. Skip it and go straight to variable. I’ll play with that. Thanks.


#7

I think confused myself earlier about the variable, I think it might work since it’s a system variable, not local :slight_smile:


#8

Ok, 2 of 4, I think! Cool.

Here is where I am. As this is a basically unattended basement gas heater, I am playing it very carefully and would rather it off then on. However if it is

  • really cold out or windy (my house is old and drafty) and
  • we are home (switch 5 is presence) & awake (disarmed) and
  • the alarm is not in siren mode and
  • the basement temp (2 contact sensors, 1 leak sensor and 1 halo smoke alarm, added and averaged together) is less than 60 (might lower this - learning)
    then turn it on and sms.

I would like to add the Halo is not ‘detect smoke’ or whatever. But I do not know the device handler options - it is a ST approved DT called ‘Halo’. I now understand how to call device attributes like the wind, but am not sure what to call for the smoke detector. Are the ST DTs hosted somewhere?

Then item number 4. :slight_smile:

Thanks for all your help!


#9


#10

What kind of attributes are available to you when you add the Halo device to a statement?


#11

image
image

hmm, good thought, maybe alarm_state


#12

I think this will work. Cheers!


#13

There you go. :slight_smile: So if you want to use that as a trigger… you’ll do

If Device:smoke changes away from clear