Announcement

Collapse
No announcement yet.

Trying to create script to run after condition device state unknown

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • jon00
    replied
    Originally posted by bartbakels View Post
    i got it, however its not documented;

    hs.DeviceInvalidValue(xxxx) to get it
    hs.DeviceInvalidValue(xxxx)= false to set
    It would be good if you posted this information here: https://forums.homeseer.com/forum/de...ugin-functions

    Leave a comment:


  • bartbakels
    replied
    i got it, however its not documented;

    hs.DeviceInvalidValue(xxxx) to get it
    hs.DeviceInvalidValue(xxxx)= false to set

    Leave a comment:


  • bartbakels
    replied
    dear all,

    but i am also looking for a way to detect devices with an unknown state. By use of an script which cycles through all devices and note the devices with an unknown state. However how do i detect this unknow state by use of a script.

    MVG

    Bart

    Leave a comment:


  • mikee123
    replied
    I could do that for critical devices. Otherwise I would have to double up on far too many devices. I hope I'll sort out the major issues I am having with my network lately, then its just a failsafe. My network has gone from running for weeks without problems, to now 2 to 3 hours before it locks up... A network restore helped for a few days, then it quickly deteriorated to where it is now... 3 hours max. Not great... With the help of these events I am trying to keep the system half operable until i found/fixed the underlying problem

    Leave a comment:


  • sparkman
    replied
    Another scenario is that they actually change, but the confirmation packet does not make it back to HS, so HS marks it as Unknown. Polling should show the right state if the node responds in that case. You may need to use a virtual device to keep track of what state you expect it to be in and then compare against it.

    Leave a comment:


  • mikee123
    replied
    No, but thats worth trying. If it works, the last command would probably be the opposite to what it shows after polling as it did not get that command. Unless its gone unknown without anything been sent.

    Leave a comment:


  • joegr
    replied
    Have you tried polling the device after it goes unknown or after the plugin restart?

    Leave a comment:


  • mikee123
    replied
    I think that could work. Most of the time, after restarting the PI, the status of the device stays as unknown until the next command has been sent. But I can incorporate action to send a on or off which should clear the status, and 'rearm' the series of events. Its just to decide what to send, on or off. Ideally I would want to find what the last command was... maybe I can use logmon for that. I'll have a think. In the meantime, I'll give the event combo a try.

    Leave a comment:


  • joegr
    replied
    I guess that I am not explaining it clearly.

    Event 1: trigger when device go to status unknown. Send on or off command or whatever sometimes helps. Set so that it triggers when the device changes from something to unknown. That way it won't trigger again. Otherwise, use the can't retrigger or x minutes.

    Event 2: trigger when the device has been status unknown for at least 30 seconds. Do the action to turn the plugin off and back on. If this does not always fix it, then set to to not retrigger for Y minutes.

    Event 3: trigger when the device has been status unknown for at least 1 minute. Send yourself a message that it couldn't be corrected. Set it to not retrigger for Z hours.



    Device becomes unknown - event 1 triggers. This fixes it, so events 2 and 3 never trigger, nor does event 1 again.

    Device becomes unknown - event 1 triggers. This does not correct it, so 30 seconds later event 2 triggers. This fixes it, so event 3 never triggers, and events 1 and 2 don't retrigger.

    Device becomes unknown - event 1 triggers. This does not correct it, so 30 seconds later event 2 triggers. This does not fix it, so 30 seconds later event 3 triggers and warns you. Events 1 and 2 retrigger every x and y minutes (unless event one is set as a change trigger, then it never retriggers). You get a warning every Z hours until you resolve it.

    Leave a comment:


  • mikee123
    replied
    The issue might get corrected after sending a on or off command. Most likely it wont though. If it doesnt, I'll want to restart the zwave PI via another event. That sometimes help getting the network running again.

    Leave a comment:


  • joegr
    replied
    Originally posted by mikee123 View Post
    That would still mean I get a notification every x minutes which I would like to avoid...
    Sorry, I thought the issue would be corrected after the first time the event fires. I guess I don't understand what you are trying to do.

    Leave a comment:


  • mikee123
    replied
    That would still mean I get a notification every x minutes which I would like to avoid...

    Leave a comment:


  • joegr
    replied
    You can set the first event that triggers (to send a command) to not repeat for x minutes to resolve that.

    My Insteon devices have an unknown status that is simply one of the device statuses just like on, off, and dim.

    Leave a comment:


  • mikee123
    replied
    Originally posted by joegr View Post
    So, make a copy of your current event and change the copy to send off the command instead of sending you a message.
    Take your original message sending event and change the trigger to where the trigger is if the device status is "unknown" for at least 30 seconds.
    If I did that, it would trigger a message after the state is unknown 31 seconds. Then trigger the second event, sent a command to turn on/off. But the original event would keep triggering if the state stays unknown, as its still over 30 seconds so it'll go into a loop or am I wrong ?

    Leave a comment:


  • sparkman
    replied
    Originally posted by mikee123 View Post
    It comes up as a trigger, see below. I did a few test events like that, and it seems to work
    Thanks!

    Leave a comment:

Working...
X