marcin Posted January 7, 2017 Share Posted January 7, 2017 (edited) Hi there, Before in basement I had a IOLinc with current sensor connected to it, and I had a program that notified us whenever Dryer finish drying. Recently I extended my ELK system down to the basement and connected current sensor to zone 19. I would like get rid of IOLinc and modify the program below to work based on Zone 19. Any suggestions? Dryer - [iD 002B][Parent 0010] If Control DRYER_IO_SENSOR is switched Off And Control DRYER_IO_SENSOR is not switched On Then Set Elk Speak Phrase 'Miscellaneous 2 ' Send Notification to 'Marcin' content 'LAUNDRY - DRYING CYCLE COMPLETED' Else - No Actions - (To add one, press 'Action') I was thinking about creating two separate programs first one set variable to 1 if zone 19 is violated (Meaning the dryer is on) Dryer Elk - [iD 001B][Parent 0010] If Elk Zone 'DRYER SENSOR' is Violated Then $Dryer_Sensor += 1 Else $Dryer_Sensor Init To 0 Second program (once dryer finished drying to notify us) Dryer Elk Notify - [iD 0011][Parent 0010] If $Dryer_Sensor is not 1 And $Dryer_Sensor is 0 Then Set Elk Speak Phrase 'Miscellaneous 2 ' Send Notification to 'Marcin' content 'LAUNDRY - DRYING CYCLE COMPLETED' Else - No Actions - (To add one, press 'Action') Unfortunately this did not produced required results. Any feedback would be appreciated. Edited January 7, 2017 by marcin Link to comment
larryllix Posted January 7, 2017 Share Posted January 7, 2017 Hi there, Before in basement I had a IOLinc with current sensor connected to it, and I had a program that notified us whenever Dryer finish drying. Recently I extended my ELK system down to the basement and connected current sensor to zone 19. I would like get rid of IOLinc and modify the program below to work based on Zone 19. Any suggestions? Dryer - [iD 002B][Parent 0010] If Control DRYER_IO_SENSOR is switched Off And Control DRYER_IO_SENSOR is not switched On Then Set Elk Speak Phrase 'Miscellaneous 2 ' Send Notification to 'Marcin' content 'LAUNDRY - DRYING CYCLE COMPLETED' Else - No Actions - (To add one, press 'Action') I was thinking about creating two separate programs first one set variable to 1 if zone 19 is violated (Meaning the dryer is on) Dryer Elk - [iD 001B][Parent 0010] If Elk Zone 'DRYER SENSOR' is Violated Then $Dryer_Sensor += 1 Else $Dryer_Sensor Init To 0 Second program (once dryer finished drying to notify us) Dryer Elk Notify - [iD 0011][Parent 0010] If $Dryer_Sensor is not 1 And $Dryer_Sensor is 0 Then Set Elk Speak Phrase 'Miscellaneous 2 ' Send Notification to 'Marcin' content 'LAUNDRY - DRYING CYCLE COMPLETED' Else - No Actions - (To add one, press 'Action') Unfortunately this did not produced required results. Any feedback would be appreciated. First. Your initial program contained a logic line that cannot perform any task ....And Control DRYER_IO_SENSOR is not switched On can only run the Else section with no programming in it and the Then section has no Wait in it to be interrupted. In your Elk monitoring you have a line ......$Dryer_Sensor += 1 that can cause results that are not handled by your last program. eg. $Dryer_Sensor could become 2 or 3 values. These two line seem to be trying to detect the same thing = dryer not running .....$Dryer_Sensor is not 1 ...And $Dryer_Sensor is 0 You could also combine your two programs into one program and avoid the usage of any variables. Only one should be required ....$Dryer_Sensor is not 0 What happens when you open your dryer door to check if the clothes are dry or add one more item? You wil get a notification. It can get complicated! I use a Dryer Running program that allows the dryer to run for 5 minutes before enabling a second program "Dryer Stopped" that detects the dryer has stopped. In the second program, I allow up to about 20 seconds for those contignuencies. Have fun! Link to comment
marcin Posted January 7, 2017 Author Share Posted January 7, 2017 Something like this? Dryer Elk - [iD 001B][Parent 0010] If Elk Zone 'DRYER SENSOR' is Violated Then $Dryer_Sensor += 1 Set Scene 'Alarm Dryer Status' On Else $Dryer_Sensor Init To 0 Set Scene 'Alarm Dryer Status' Off and this: Dryer Elk Notify - [iD 0011][Parent 0010] If $Dryer_Sensor is not 0 Then Wait 5 minutes Set Elk Speak Phrase 'Miscellaneous 2 ' Send Notification to 'Marcin' content 'LAUNDRY - DRYING CYCLE COMPLETED' Else - No Actions - (To add one, press 'Action') Link to comment
larryllix Posted January 8, 2017 Share Posted January 8, 2017 (edited) For a very simple program to expand as you find quirks try this. Dryer Elk - [iD 001B][Parent 0010] If .....Elk Zone 'DRYER SENSOR' is Violated Then .....Set Scene 'Alarm Dryer Status' On Else .....Set Scene 'Alarm Dryer Status' Off .....Wait 5 minutes .....Set Elk Speak Phrase 'Miscellaneous 2 ' .....Send Notification to 'Marcin' content 'LAUNDRY - DRYING CYCLE COMPLETED' BTW: When your set an "init variable", it doesn't affect the RAMvariable copy unless your ISY does a reboot or power up. Then the init value is copied to the RAM copy of the variable. BTW2: When you use var += 1 you are incrementing the current value and the value can fool testing for logic statements. Best practice is to just use .....$var = 1 .....$var = 0 Then you can depend on the values. I defined a pair of Integer variable with their init values set to 1 and 0, called $cTrue and $cFalse respectively. Then I can use program lines like this. If ....$sDryer_sensor = $cTrue Then ,,,, Edited January 8, 2017 by larryllix Link to comment
marcin Posted January 8, 2017 Author Share Posted January 8, 2017 thank you larryllix I will try it tomorrow. Link to comment
larryllix Posted January 8, 2017 Share Posted January 8, 2017 thank you larryllix I will try it tomorrow. Please note I made some errors and fixed them last minute Link to comment
Recommended Posts