Jump to content

Need help from advanced programming gurus...


Scottmichaelj

Recommended Posts

First question, is yet another sunset programming question.

 

Here in the PWN sunset gets late, at mid summer its around 9:30-10pm. By that time I already and well in my Pjs and in bed. :-P  

 

I have a motion using dusk/dawn sunset program:

 

Sunset [inside]
 
If
        From    Sunset  -  3 hours 
        To      Sunset  +  2 hours  (same day)
    And Status  'Kitchen-Motion-Sensor / Kitchen-Motion-Dusk.Dawn' is On
 
Then
           Set Scene 'Sunset' On
           Wait  5 seconds
           Resource 'HD Shades - ALL (Close)'
 
Else
   - No Actions - (To add one, press 'Action')
 
But sometimes I'm all comfy tucked away in bed and the sunset scene will run and I cant turn it off unless I disable the program.
 
I thought about using variables and two programs instead of one but I have a large install so not sure how if I turned on another scene I could easily change the variable since theres no way to know the "scene status" is truly ON/OFF unless you use a unique device. Using if "switched on" per device would be a huge mess. This can also become a pain if you make a change. There has to be a better way. I also thought about "disabling" the program when another scene ran but again no clean way to know. Suggestions anyone?
 
-------------------------------------------
 
Second question,
 
2 Doors, 2 lights, 2 motions. When either door is opened both lights go on, and then if no motion detected they all go off. Works perfect "most" of the time.
 
Program is:
 
Server Room Motion and Doors
 
If
        Elk Zone 'Garage Bomber DR' is Violated
     Or Elk Zone 'Server Room Door' is Violated
     Or Elk Zone 'Motion-Server Rm' is Violated
 
Then
        Set Scene 'Workshop' Fast On
        Set 'Hall (Foyer-DS)' 75%
        Set 'Hall (Garage-DS)' 75%
 
Else
        Wait  15 minutes 
        Set Scene 'Hall (Downstairs)' Off
        Set Scene 'Workshop' Off
 
HOWEVER, I don't want the hall lights to turn off if they are ON manually or by a scene. Example, Sunset scene turns those hall lights on like I want them to be, then I walk out into the server room, lights turn on, I come back in, I just want the lights off in the server room not the hall. Right now the hall will just turn off. Again two programs? Variables? Argh. Suggestions welcome.
 
Thanks in advance for the help, suggestions. Maybe I am making this harder than it needs to be?
 
Link to comment

I'm not positive I understand question 1.  I guess you are asking about disabling the program if you are already in bed.  You obviously need some indication in ISY that you are in bed.  Pretty much, that means you need to do something that indicates you are in bed.  Like a door sensor on your bedroom door?  A KPL button by your bedside? I don't know what, but that just add the status of that device to the program.

 

Question 2.  Again, not positive I get your exact situation.  But I have programs that trigger on an elk zone opening, turn a light on, wait, then turn it off (all in the "then").  But I add to the "if"

 

if

control is not switched on

and 

(

other conditions

)

 

Then

light on

wait 

light off

Else

. . . 

 

Using the "control not switched on" allows me to abort the timer by hitting the on switch before the thing times out and shuts down the light.

 

You can also add a folder and put the above program in that folder.  In the condition of the folder, put things light the status of a light being on as a disabling thing

Link to comment

I'm not positive I understand question 1.  I guess you are asking about disabling the program if you are already in bed.  You obviously need some indication in ISY that you are in bed.  Pretty much, that means you need to do something that indicates you are in bed.  Like a door sensor on your bedroom door?  A KPL button by your bedside? I don't know what, but that just add the status of that device to the program.

 

Question 2.  Again, not positive I get your exact situation.  But I have programs that trigger on an elk zone opening, turn a light on, wait, then turn it off (all in the "then").  But I add to the "if"

 

 

Question 1 = I am not always in bed  :-P BUT maybe on the couch or in my Home Theater watching a movie. So theres no real pattern.

 

Question 2 = I never have used the folder conditions, I'll check out the wiki for how they work. The issue still is that I dont want to have to override it. I will be out of the area (hall) after closing the door and if its sunset I want the light on. As it is now it turns off and I manually have to turn it back on, which is what I am trying to not have to do (the manual interaction).

Link to comment

Question 1 = I am not always in bed  :-P BUT maybe on the couch or in my Home Theater watching a movie. So theres no real pattern.

 

Question 2 = I never have used the folder conditions, I'll check out the wiki for how they work. The issue still is that I dont want to have to override it. I will be out of the area (hall) after closing the door and if its sunset I want the light on. As it is now it turns off and I manually have to turn it back on, which is what I am trying to not have to do (the manual interaction).

1) ISY can't read your mind.  You have to have some condition that exists in ISY to have it affect actions.  IF that means installing a weight sensor under your couch cushion, then I guess you need to do that.

2) Again, ISY can't read your mind.  If the condition exists in ISY, then you can set programs and/or folders to respond to those conditions.

Link to comment

1) ISY can't read your mind. You have to have some condition that exists in ISY to have it affect actions.

2) Again, ISY can't read your mind. If the condition exists in ISY, then you can set programs and/or folders to respond to those conditions.

Note to self - file a feature request with Michel to work on the ISY mind reading capability.

Link to comment

Yes, check status of key devices in a scene. That would work. Dedicated device certainly would work. Motion in certain rooms? Doors open oe closed? You will have to identify certain key events or conditions as indicators that you want to halt execution.

 

No, you are not overthinking this. This will take a few extra programs.

Link to comment

Yes, check status of key devices in a scene. That would work. Dedicated device certainly would work. Motion in certain rooms? Doors open oe closed? You will have to identify certain key events or conditions as indicators that you want to halt execution.

 

No, you are not overthinking this. This will take a few extra programs.

I was trying to find "unique devices" but my sunset scene is also the same as relaxing but lower levels. In the summer I am usually using relaxing more than sunset due to sunset times being so late. The easiest solution probably is like you said, to just add a on/off module to create a "unique identifier" then sunset turns it on one, relaxing turns it off and another on, and so on as required.

 

See you read my mind perfectly! Lol Thanks.

Link to comment

I was trying to find "unique devices" but my sunset scene is also the same as relaxing but lower levels. In the summer I am usually using relaxing more than sunset due to sunset times being so late. The easiest solution probably is like you said, to just add a on/off module to create a "unique identifier" then sunset turns it on one, relaxing turns it off and another on, and so on as required.

 

See you read my mind perfectly! Lol Thanks.

That's what KPL's are for.

Link to comment

That's what KPL's are for.

TBH I think I only have two KPLs in my home. Maybe I should add a few more in key areas. My home is pretty automated and its very rare that I actually use a switch. I been living with this sunset issue for a while now trying to sort a good way to do it. Its been on the to do list but low priority, but its finally bothering me enough to look at it.

Link to comment

I used a lot of KPLs in tabletop enclosures until Alexa and the portal. Actually the KPL is still handy when I'm eating or talking or drinking or toking B)

Link to comment

If you dont want to add KPLs, and if you have access to andoroid tablets or cell phones throughout the house, you might be able to create a screen widget to toggle an ISY program to act as a unique device. This may require apps that you dont currently have.

 

Others have mentioned the echo, but this requires a portal subscription or extraordinary effort.

Link to comment

If you dont want to add KPLs, and if you have access to andoroid tablets or cell phones throughout the house, you might be able to create a screen widget to toggle an ISY program to act as a unique device. This may require apps that you dont currently have.

 

Others have mentioned the echo, but this requires a portal subscription or extraordinary effort.

Oh come on now, it isn't that hard without the portal! :-P

 

I use IFTTT, not so bad.  If I were starting from scratch, I would use the portal, but I already have a bunch of things that access the ISY using REST.

 

Steps:

1) install self signed SSL on your ISY

2) open port 443 on your router and point to ISY LAN IP

3) subscribe to a DDNS company (I use no-ip)

4) open an account with IFTTT (free) and link your Alexa account

5) set up commands on IFTTT

     - Use "Alexa" for your "this"

     - Use "webhook" for your "that"

     - go to http://yourisylanip/rest/nodes to get a list of all the nodes on your system

     - use "find" function in your webbrowser and search the name of the device or scene you are looking to add to Alexa

     - the node name is will look similar to this <pnode>45 8D 28 1</pnode>

     - enter rest command into "url" section of the webhook, all the other stuff leave blank.  It will look similar to this

      https://admin:password@yourddnsurl/rest/nodes/16 47 2B 1/cmd/DOF    (DOF is device off)

     - say "Alexa, trigger <your chosen statement here>" and Alexa will respond "sending that to ifttt" and 1 or 2 second later it happens.

 

The process is very similar using google home.

Link to comment

For for the first question: I installed a few on/off modules in a few areas for 'unique' devices. So just add it to the other scences programming to turn on, then add a line to the sunset programming if that unique device is off then run sunset otherwise skip? Sound right?

 

For the second question: Would this be better handled into two programs which are almost the same? Do one program for during the daytime hours to turn on the hall then from sunset to sunrise do a second program leaving out the hall being turned off?

 

EDIT: My second question, 2 programs. Thoughts?

 

Program 1 =

 

Server Room Motion and Doors (Day)

 
If
        From    Sunrise
        To      Sunset  -  3 hours  (same day)
    And Elk Zone 'Garage Bomber DR' is Violated
     Or Elk Zone 'Server Room Door' is Violated
     Or Elk Zone 'Motion-Server Rm' is Violated
 
Then
        Set Scene 'Workshop' Fast On
        Set 'Hall (Foyer-DS)' 75%
        Set 'Hall (Garage-DS)' 75%
 
Else
        Wait  15 minutes 
        Set Scene 'Hall (Downstairs)' Off
        Set Scene 'Workshop' Off
 
Program 2 = 
 
Server Room Motion and Doors (Nite)
 
If
        From    Sunset  -  3 hours 
        To      Sunrise (next day)
    And Elk Zone 'Garage Bomber DR' is Violated
     Or Elk Zone 'Server Room Door' is Violated
     Or Elk Zone 'Motion-Server Rm' is Violated
 
Then
        Set Scene 'Workshop' Fast On
        Set 'Hall (Foyer-DS)' 75%
        Set 'Hall (Garage-DS)' 75%
 
Else
        Wait  15 minutes 
        Set Scene 'Workshop' Off
 
BTW I have removed all my amazon devices due to privacy. The devices are nice however I am moving away from cloud dependency and want everything local when possible.
Link to comment

 

For for the first question: I installed a few on/off modules in a few areas for 'unique' devices. So just add it to the other scences programming to turn on, then add a line to the sunset programming if that unique device is off then run sunset otherwise skip? Sound right?

 

For the second question: Would this be better handled into two programs which are almost the same? Do one program for during the daytime hours to turn on the hall then from sunset to sunrise do a second program leaving out the hall being turned off?

 

EDIT: My second question, 2 programs. Thoughts?

 

Program 1 =

 

Server Room Motion and Doors (Day)

 
If
        From    Sunrise
        To      Sunset  -  3 hours  (same day)
    And Elk Zone 'Garage Bomber DR' is Violated
     Or Elk Zone 'Server Room Door' is Violated
     Or Elk Zone 'Motion-Server Rm' is Violated
 
Then
        Set Scene 'Workshop' Fast On
        Set 'Hall (Foyer-DS)' 75%
        Set 'Hall (Garage-DS)' 75%
 
Else
        Wait  15 minutes 
        Set Scene 'Hall (Downstairs)' Off
        Set Scene 'Workshop' Off
 
Program 2 = 
 
Server Room Motion and Doors (Nite)
 
If
        From    Sunset  -  3 hours 
        To      Sunrise (next day)
    And Elk Zone 'Garage Bomber DR' is Violated
     Or Elk Zone 'Server Room Door' is Violated
     Or Elk Zone 'Motion-Server Rm' is Violated
 
Then
        Set Scene 'Workshop' Fast On
        Set 'Hall (Foyer-DS)' 75%
        Set 'Hall (Garage-DS)' 75%
 
Else
        Wait  15 minutes 
        Set Scene 'Workshop' Off
 
BTW I have removed all my amazon devices due to privacy. The devices are nice however I am moving away from cloud dependency and want everything local when possible.

 

 

I guess if you have the on/off module just sitting around and have no other use for it, you can use it as a "flag".  But that seems like an expensive way to track a scene.  Why not use a program?

 

if

<list all the things that control the scene> is switched on

and

<list all the things that control the scene> is not switched off

then

- - -

else

- - - 

 

Now the true/false status of this program tracks the scene.

 

I guess this is a little more work to set up and if you change what devices control the scene the program would need to be manually re-configured.  My guess is that your scenes aren't changing often.

Link to comment

I guess if you have the on/off module just sitting around and have no other use for it, you can use it as a "flag". But that seems like an expensive way to track a scene. Why not use a program?

 

if

<list all the things that control the scene> is switched on

and

<list all the things that control the scene> is not switched off

then

- - -

else

- - -

 

Now the true/false status of this program tracks the scene.

 

I guess this is a little more work to set up and if you change what devices control the scene the program would need to be manually re-configured. My guess is that your scenes aren't changing often.

The only use for the on/off modules would be as you said virtual scene flag. The code above you quoted was my two programs for the hallway not turning off automatically during the evening.

Link to comment

The only use for the on/off modules would be as you said virtual scene flag. The code above you quoted was my two programs for the hallway not turning off automatically during the evening.

I just hit the quote button without deleting all the stuff I wasn't talking about.

 

Just saying,  running an on/off module just to have as a flag seems kind of less than ideal.

 

Don't you have at least one device already in those scenes that is only ever operated by the scene?  Any device that is a scene controller that is not also a responder to some other scene will work.  Any such device will always track the scene.  The only exception is that all devices are responders to ISY so if an ISY program controlled or if you manually did it from ISY, it would be out of sync with the scene, but my guess is that you aren't doing that.

 

If it were me, I would have programs track the scene as I listed above.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...