Jump to content

Control condition not picking up the switch press...


AAdsit

Recommended Posts

Posted

I must have completely overlooked something in the manual. I just want to start a timer when a switch is pressed. The rest of the program works, just not catching the initial key press.

((Hall_Bath_Fan_Turn_On))

If

    'Hall Bath Fan' is switched ON

Then

    $Hall_Bath_Fan_Time_left += 20  <-- set as a State Variable

    Run Program 'Hall_Bath_Fan_Decrement' (If)

Else

    No Actions

Hall_Bath_Fan_Decrement handles counting down the 20 minutes and turning off the Fan.

For some reason, ISY isn't catching the switch press.  If I force the then statement, the programs run fine.

Does the switch setup have to be set as a condition to the Program?

Posted

Assuming 'Hall Bath Fan' is the correct device that should work fine.

What happens if you switch to the Main tab and hi-lite that device, then go turn the switch on, does the ISY change the state from Off to On?

You didn't ask for programming advice beyond the question you asked, but state variables use more resources than integer variables and I'm not certain why you would need a state variable for this application.  Also unless it's an adjustable value I'm not even sure I would use a variable.

Posted
1 hour ago, MrBill said:

Assuming 'Hall Bath Fan' is the correct device that should work fine.

What happens if you switch to the Main tab and hi-lite that device, then go turn the switch on, does the ISY change the state from Off to On?

You didn't ask for programming advice beyond the question you asked, but state variables use more resources than integer variables and I'm not certain why you would need a state variable for this application.  Also unless it's an adjustable value I'm not even sure I would use a variable.

Hall Bath Fan is the correct device. If I turn it on in the ISY Tree, it initiates the timer. It also turns the fan on. If I press the button, it does not initiate the program.

I am using a state variable as the instruction says that integer variables cannot be used for decision in programs. it is variable as it counts down for 20 minutes. Did I read that wrong?

((Hall_Bath_Fan_Decrement))

If

    $Hall_Bath_Fan_Time_Left > 0

Then

    Wait 1 minute

    $Hall_Bath_Time_Left -= 1

    Run Program 'Hall_Bath_Fan_Decrement' (If)

Else

    Set 'Hall Bath Fan' Off

These two programs were pretty much copied from somewhere in the forum.

Posted
36 minutes ago, AAdsit said:

Hall Bath Fan is the correct device. If I turn it on in the ISY Tree, it initiates the timer. It also turns the fan on. If I press the button, it does not initiate the program.

So Specifically the question that I asked is about communication in the direction of the switch TO ISY.  It's good to know that the ISY can talk to the switch, and if "If I press the button" means if you turn on the switch the ISY doesn't realize the switch turned on then we've established that communication is bad the other direction.  The purpose of the question was to determine if communication is occurring... if we don't have that the program will never work.

Given that we have communication from the ISY to the Switch, the first thing that I would try in this case is to Factory Reset the switch.  Pull the bottom programming/air gap lever out, wait 10 seconds, push the lever all the way in and HOLD IT IN until the long beep stops.  (Don't let up when the beep starts, keep hold the switch in until the beep is done.)  Next, in the device tree select the device, right click it and choose Restore Device.   After the ISY is done reprograming the switch repeat the test and let us know if it works yet.

44 minutes ago, AAdsit said:

I am using a state variable as the instruction says that integer variables cannot be used for decision in programs. it is variable as it counts down for 20 minutes. Did I read that wrong?

I'm not looking at the instructions, so I don't know if the words there could be better or if you misinterpreted them.  However for the program as written you only need and integer variable.  

The difference?  In an IF statement a State variable will cause the IF to run anytime it changes.  You're not relying on that magic property here, instead you are specifically using 'Run Program' anytime you want the program to run.

Another way to say this is that a State Variable can be use in an IF statement as either a trigger or a filter.  Conversely, an integer variable can only be used as a filter.  Triggers can start execution, Filters prevent it. 

State Variables use more resources, as such it's best to use an Integer Variable unless the magic property of the state variable being able to trigger a program is needed.

Another good habit is to make the first character of all variable names either a lower case s or lower case i to indicate it's type.  That just makes the programs easier to read and better organizes the variable drop downs in the admin console.

Lastly I can't tell if you're carefully typing programs in the forum or if you've figured out how to paste them, but if you haven't figured it out.... click the program name in the program tree and right click and choose Copy to Clipboard.  then you can literally ctrl-v paste it into a forum message.

Posted
8 minutes ago, Techman said:

Wouldn't a simple program work just as well?

 

If

    FAN is switched on

THEN

     Wait 20 minutes

     Set Fan OFF

ELSE

 

That's actually exactly how I do it....   I was thinking about suggesting that next round... but wanted to use the moment to teach state vs integer first.

  • Like 1
Posted

Well, I factory reset the switch and them restored the switch via ISY. Hit the switch, and the status on ISY does not change. All of my other switches in the network except these NEW switches (installed yesterday) pass to ISY. ISY passes to the switch. So it is definitely a one way circuit.

And no, I did not know you could copy/paste./ Good to know.

 

Posted

If you query the switch from the ISY what response do you get?

What's the 4 digit date code and the model number of the switch?

If you disconnect the load wire from the switch does the status then show correctly in the ISY?

Posted
9 hours ago, Techman said:

If you query the switch from the ISY what response do you get?

What's the 4 digit date code and the model number of the switch?

If you disconnect the load wire from the switch does the status then show correctly in the ISY?

Query shows this:

Hall Bath Fan Status On Sat 2021/09/11 08:11:45 AM System Log
Hall Bath Fan On Level 100% Sat 2021/09/11 08:11:45 AM System Log
Hall Bath Fan Ramp Rate 28 Sat 2021/09/11 08:11:45 AM System

Log

 

Date code and Model Number 1319, Model 2477S

Disconnected load, status unchanged.

Posted

Is there another Insteon switch next to this one? like the light? same circuit? If so does it work as expected?  If so this may be a defective switch.

I'd pull the switch out of the wall, and wire it up with a test cord (cap the red wire) and plug it in to the same circuit as the PLM, and retest.

testcord.thumb.jpg.3dca46dc6faf2d74416848f26cc9ee76.jpg

(pic shamelessly stolen from a @Teken post somewhere else on this forum.)

Posted
2 hours ago, MrBill said:

Is there another Insteon switch next to this one? like the light? same circuit? If so does it work as expected?  If so this may be a defective switch.

I'd pull the switch out of the wall, and wire it up with a test cord (cap the red wire) and plug it in to the same circuit as the PLM, and retest.

testcord.thumb.jpg.3dca46dc6faf2d74416848f26cc9ee76.jpg

(pic shamelessly stolen from a @Teken post somewhere else on this forum.)

Yes, it is right next to the lights switch. It also does not trigger ISY, but operates the lights. I can operate the switch via the ISY (again, one direction signal). I will pull out and test near the PLM.

Had a third switch I received with same order. Wired up near PLM, added to ISY. Same exact response. ISY will trigger the switch, but the switch will not trigger the ISY. Could 3 switches all be bad, right out of the box?

Its almost like the ISY is full? Or I haven't done something right between when I set all this up and the recent adding of two switches. I have 125 devices in the topology.

I have removed the switch from the ISY and readded. Same.

Posted
20 minutes ago, AAdsit said:

Could 3 switches all be bad, right out of the box?

Doubtful.   more likely bad signal/noise/signal suckers etc.

Do you have polyglot running either via Pi or Polisy?   if so load the nodeserver ISY Inventory so we can see counts?

Do you have pro or regular version of ISY?  Pro does have a smaller node limit, although I don't recognize these symptoms as being that issue.   

You could also count links in the PLM to see if the PLM is full/near full.  Tools > Diagnostics > Show PLM links table > Count.   It should be noted that OTHER Insteon traffic screws up the count.  If you can do it while no one else is home, and repeat it several times until you think you've got a good count.  If you have motion detectors don't make motion during the count.  If you want to stop all of your programs from running, create a temporary integer variable and leave it's value at zero, then click My Programs at the top of the program tree, Create a folder condition, in the IF for that folder enter a condition "If Temp_variable is 1" (Which is false, because the value of Temp_variable is 0)... and save programs... this will immediately prevent all programs from running... be sure to remove the condition and resave when you are done with the counts and want your programs to run again.

Posted

Do not have Polisy running. I have the Pro version of ISY. PLM link count = 992. I don't have any programs that run during the day.

I did relocate Insteon PLM to another outlet -- closer to the switches. Also, is on the same "side" of the breaker box. Did not help.

Posted

You’re at the limit of links so even if not root of this problem, you’ll likely need to review scenes to reclaim some space. My guess is you’ve used lots of scenes.

Was the switch in question a recent addition?

Another thing to try is to restore plm from ISY to see if you get back any orphan links.

Can you pull switch from wall and attach to wiring harness shown above and plug in to same outlet as plm ?

Posted
29 minutes ago, hart2hart said:

You’re at the limit of links so even if not root of this problem, you’ll likely need to review scenes to reclaim some space. My guess is you’ve used lots of scenes.

Was the switch in question a recent addition?

Another thing to try is to restore plm from ISY to see if you get back any orphan links.

Can you pull switch from wall and attach to wiring harness shown above and plug in to same outlet as plm ?

I don’t have a ton of scenes, but I do have a good nite that basically turns off everything and has 3 controller buttons.

switch was recent addition.

I plugged in the switch to the same circuit as the PLM. I’ll try restoring the plm from ISY.

Posted

Being that the devices respond to a query means that the PLM is able to communicate with the device. I agree that you've reached the maximum link tables that the PLM can hold which is about 1000. Some of the older PLMs had a lower capacity.

Adding to what hart2hart said, when you delete a device from the ISY the link tables still take up space in the PLM. It's best to do a factory reset on the PLM then a restore PLM. That will reclaim link space in the PLM.

If you have any battery operated devices be sure to disable automatic writes to battery devices in the admin console before you do a restore PLM. You'll then have to restore the battery devices one at a time making sure that only one of them is in the linking mode at any one time.

Posted
9 hours ago, hart2hart said:

If you restore with same PLM, it does not update any device except for the PLM.

Only takes a few minutes.

Restored PLM and my links went down to 71 (from 900+). i'm pretty sure the high number was from where (stupid me) added devices and imported links from my previous insteon hub. I had probably 200+ scenes (which I know weren't good scenes, most were dead links. I had deleted them, but guess all those dead links were still in there).

For the nubies -- like they say - do NOT add insteon with links..... They mean it.

My new switches work now. And I simplified the fan timeout (thanks, was trying to make it more complicated than I needed).

Hall_Bath_Fan_Turn_On - [ID 0005][Parent 0001]

If
        'Hall Bath Fan' is switched On
 
Then
        Wait  25 minutes 
        Set 'Hall Bath Fan' Off
 
Else
   - No Actions - (To add one, press 'Action')
 

Thanks especially to MrBill, Techman and hart2hart who exhibited a truckload of patience.

  • Like 3
Posted

@AAdsit  Pehaps something to consider regarding your program. If the switch was pressed to turn the fan on, the program would be running true until it turns off the fan. However if the ISY for some reason rebooted during that time the program will be false after reboot so the fan would not turn off until you intervened. Same result if the fan somehow turned on without the switch being presses, for instance if it were turned on via an app on your phone or even through the admin console.

If you were to use "Status" instead of "Switched" then anytime the fan was on the program would run true and turn off the fan.

If the ISY reboots while the program is true, you will need another trigger in the condition of the program to retrigger the program once reboot s complete. oOr you can enable "Run at startup" as well.

  • Like 1
Posted
7 minutes ago, TJF1960 said:

@AAdsit  Pehaps something to consider regarding your program. If the switch was pressed to turn the fan on, the program would be running true until it turns off the fan. However if the ISY for some reason rebooted during that time the program will be false after reboot so the fan would not turn off until you intervened. Same result if the fan somehow turned on without the switch being presses, for instance if it were turned on via an app on your phone or even through the admin console.

If you were to use "Status" instead of "Switched" then anytime the fan was on the program would run true and turn off the fan.

If the ISY reboots while the program is true, you will need another trigger in the condition of the program to retrigger the program once reboot s complete. oOr you can enable "Run at startup" as well.

I am learning the nuisance of control vs status. I’m leaning toward status for many reasons. Thanks.

  • 3 months later...
Posted
On 9/11/2021 at 2:04 PM, Techman said:

Being that the devices respond to a query means that the PLM is able to communicate with the device. I agree that you've reached the maximum link tables that the PLM can hold which is about 1000. Some of the older PLMs had a lower capacity.

Adding to what hart2hart said, when you delete a device from the ISY the link tables still take up space in the PLM. It's best to do a factory reset on the PLM then a restore PLM. That will reclaim link space in the PLM.

If you have any battery operated devices be sure to disable automatic writes to battery devices in the admin console before you do a restore PLM. You'll then have to restore the battery devices one at a time making sure that only one of them is in the linking mode at any one time.

@Techman I am pushing just under 900 links in my PLM.  In 2017, Chris Jahn wrote the following post 

 where he says: 

Quote

 

Restore PLM

ISY keeps track of the PLMs you have used, so for example, if you started using a new PLM without doing a restore PLM, you would have some devices linked to the old PLM and some to the new.

When you do restore PLM, it goes through all the devices looking for PLM links (either old PLM links, or new ones). If its a link to an old PLM, it replaces it with the address of the new PLM. It also adds the corresponding link to the new PLM.

 

 QUESTIONS:  If I do the restore w/o the factory reset of the PLM, per Chris's directions, will I:

-reclaim unused links?

-need to re-establish my battery operated devices? 

 

Thanks

 

 

Posted (edited)

It's possible that your PLM has reached its capacity.

When you delete certain items the link tables will continue remain in the PLM. The only way to remove those unused links and reclaim storage space in the PLM is to do a factory reset on it then a Restore PLM. 

If you don't have any battery-operated devices then it should go smoothly.  If you do have battery operated devices then you need to disable automatic writes to battery devices in the admin console before you do a restore PLM. You'll then need to put each battery device into the linking mode, only one at a time, and then do a restore device. Take the device out of the linking mode before you restore the next one.

Don't forget to do an ISY backup before you do anything.

Edited by Techman
Posted
15 minutes ago, Techman said:

It's possible that your PLM has reached its capicity.

When you delete certain items the link tables will continue remain in the PLM. The only way to remove those unused links and reclaim storage space in the PLM is to do a factory reset on it then a Restore PLM. 

If you don't have any battery-operated devices then it should go smoothly.  If you do have battery operated devices then you need to disable automatic writes to battery devices in the admin console before you do a restore PLM. You'll then need to put each battery device into the linking mode, only one at a time, and then do a restore device. Take the device out of the linking mode before you restore the next one.

Don't forget to do an ISY backup before you do anything.

It was the PLM overloaded. I had deleted a bunch of dead links, but the PLM still had them (1,000). Factory reset fixed it.

Guest
This topic is now closed to further replies.

×
×
  • Create New...