Jump to content

Another Insteon MSII Query


JLOB

Recommended Posts

Posted

What is the current reported battery level? Is the sensor reporting motion correctly?
Have you tried putting it in set mode when doing query?


Sent from my iPhone using Tapatalk

  • Like 1
Posted
There's not much of a program.  It just queries the sensor.  The underlying problem is that the sensor doesn't reset with the new battery.

 

Kitchen Motion Low Battery - [iD 008D][Parent 0001]

If

        Time is  4:00:00AM

    And 'Kitchen / Kitchen Miscellaneous Sensor' Battery Level  

Then

        Send Notification to 'XXX XXX' content 'Sensor Battery-1'

 

Else

   - No Actions - (To add one, press 'Action')

 

 

J.

 

I don't have a MSII but I see a few possible problems.

 

First you are not querying the MSII. Insteon doesn't usually work like that.

 

Is the battery level an analogue parameter? If so you didn't post a value. If not having two event based triggers ANDed should never run Then.

 

Sent using Tapatalk

 

 

 

Posted
3 hours ago, larryllix said:

I don't have a MSII but I see a few possible problems.

 

First you are not querying the MSII. Insteon doesn't usually work like that.

 

Is the battery level an analogue parameter? If so you didn't post a value. If not having two event based triggers ANDed should never run Then.

 

 

 

 

 

Larry,

Not sure about the Query.  Do I query from the program, and THEN check the status?

Next:  Mea culpa for the program code.  Either the copy was short, or I messed up the paste, but the correct code follows....O hope.

J.

Kitchen Motion Low Battery - [ID 008D][Parent 0001]

If
        Time is  4:00:00AM
    And 'Kitchen / Kitchen Miscellaneous Sensor' Battery Level <= 10%
 
Then
        Send Notification to 'John OBoyle' content 'Sensor Battery-1'
 
Else
   - No Actions - (To add one, press 'Action')
 

 

Posted
3 hours ago, gzahar said:

What is the current reported battery level? Is the sensor reporting motion correctly?
Have you tried putting it in set mode when doing query?


Sent from my iPhone using Tapatalk

Not sure how to put it in set mode from within a program. 

J.

 

Posted
7 minutes ago, JLOB said:

Not sure how to put it in set mode from within a program. 

J.

 

Sorry, not talking about program.  In order to query the MSII (and potentially reset the battery level) you must wake it up first by manually putting it in Link mode (press & hold set button until LED blinks green).  Once in link mode, go to admin console, right click motion sensor node and select query.  After you have done the query, go back to MS II and press (don't hold this time) the set button.  It should now be showing double green blinks.  Now press set button one more time and blinking should stop.  At this point, hopefully battery level is showing proper level and everything is back to normal.

Posted
11 hours ago, JLOB said:

Not sure how to put it in set mode from within a program. 

J.

 

You can't put it into SET mode from a program, so you just have to wait for it to wake up and then query it.  It wakes up every time it detects motion.  So create a program that executes a query whenever motion is detected.  Here's the program I use:

Record UH-MS Data - [ID 003F][Parent 0066]

If
        'UH-Motion Sensor.1 Motion' is switched On
 
Then
        Set 'UH-Motion Sensor.1 Motion' Query
        Wait  5 seconds
        $iUH_Temp  = 'UH-Motion Sensor.1 Motion' Temperature °F
        $iUH_Luminance  = 'UH-Motion Sensor.1 Motion' Luminance %
 
Else
   - No Actions - (To add one, press 'Action')
 

You only need the first line after the THEN.  That line actually executes the query and updates the MSII status within the ISY.  I use the other three lines to capture certain sensor values to integer variables that I use in other programs.  Creating this kind of program will ensure that the ISY has the latest battery level, or at least the battery level as of the last time motion was detected.

 

Posted
12 hours ago, kclenden said:

You can't put it into SET mode from a program, so you just have to wait for it to wake up and then query it.  It wakes up every time it detects motion.  So create a program that executes a query whenever motion is detected.  Here's the program I use:

THAT'S EXACTLY what I needed to know.  Thanks.  My first small test worked well.  Now I need to learn how to extract the data from the device.  I did (not sure how I did it) see the temperature, the battery level, and the luminance all together once in the log.  I also saw the luminance and the temperature with no battery level, and again the luminance by itself.  I looked at your examples of data collection, but I'm still a little in the dark.  I will keep trying however.  Thanks again.

JLOB

Posted
On 9/4/2019 at 1:25 AM, kclenden said:

$iUH_Temp = 'UH-Motion Sensor.1 Motion' Temperature °F

$iUH_Luminance = 'UH-Motion Sensor.1 Motion' Luminance %

I'm not sure how to achieve that coding in my ISY program.  Can you elaborate?

Thanks.

JLOB

 

Posted (edited)
1 hour ago, JLOB said:

I'm not sure how to achieve that coding in my ISY program.  Can you elaborate?

Thanks.

JLOB

 

$iUH_Temp and $iUH_Luminance are Integer variables. See the 'i' after the '$'? That is his way of indicating they are Integer types. Go to the Integer variable tab and Add two new variables. Rename them to suit your needs, as he has done to "iUH_Luminance" etc.

501539631_Integervariableaddition.thumb.jpg.4ac655d0defc164766d06808ba932da1.jpg

Now go to your program and after selecting Action, select Variable in the pulldown. Click on the variable name box and scroll down until you see your variable name. Select it.

In the third box, select '='. In the fourth box, click on the small caret symbol and it will rotate through all the types of elements that variable can have copy to that variable.

The last two boxes you select the device parameter you won't to copy the value of.

When you get the line you like, click on Add to Then. When done editing always click Save at the bottom of the program tree.

606008719_Programlinecreation.thumb.jpg.bd9643debe336da11564d68c6e85f002.jpg

Edited by larryllix
Posted
3 hours ago, larryllix said:

Now go to your program and after selecting Action, select Variable in the pulldown. Click on the variable name box and scroll down until you see your variable name. Select it.

In the third box, select '='. In the fourth box, click on the small caret symbol and it will rotate through all the types of elements that variable can have copy to that variable.

Larry,

After playing around with the carets and stuff, I got where I wanted by accident.  I then went back and got there on purpose.  Hopefully I'll remember this the next time its needed!

Thanks.

JLOB

  • Like 1
Posted
4 hours ago, JLOB said:

Larry,

After playing around with the carets and stuff, I got where I wanted by accident.  I then went back and got there on purpose.  Hopefully I'll remember this the next time its needed!

Thanks.

JLOB

It will get easier as you go. First you just have to get familiar with how the admin console works and what the capabilities are. You are on your way.

Glad it is working out for you. Have lots of fun with it!! 

Posted

If I might, I'd like to add a couple of questions to this thread.  

1) In the sample program, the motion sensor node was set to query but then the temperature and luminescence was copied to variables. I have my MSIIs running on USB power and all I want to measure if the temperature.  I set the temperature node to query and then copied the temperature to a variable.  Is there anything problematic with doing that way? 

2) I'm interested in logging data over a long period of time.  It was suggested to me to download the ISY Log to my computer which has the option of putting the log into an Excel file.  It looks like this should work fine, except in my attempts to try this, it appears that the temperature values from the query are only recorded in the log only if the temperature has changed.  I tried copying the temperature to a variable just after the query but that also did not report anything to the log.  This is someone off topic but that can be excused for a newbie, I'd like know if there is any way to force the result of a query to be reported to the log or even better to report the current value of a variable to the log.  It would seem important for many other types of applications to be able to log the current value of variables.  

Any help will be greatly appreciated.  (I don't know how my status was updated to "Advanced Member" but at best I'd classify myself as "Intermediate", and that might be  a push.)

Posted
4 hours ago, Jimini said:

If I might, I'd like to add a couple of questions to this thread.  

1) In the sample program, the motion sensor node was set to query but then the temperature and luminescence was copied to variables. I have my MSIIs running on USB power and all I want to measure if the temperature.  I set the temperature node to query and then copied the temperature to a variable.  Is there anything problematic with doing that way? 

2) I'm interested in logging data over a long period of time.  It was suggested to me to download the ISY Log to my computer which has the option of putting the log into an Excel file.  It looks like this should work fine, except in my attempts to try this, it appears that the temperature values from the query are only recorded in the log only if the temperature has changed.  I tried copying the temperature to a variable just after the query but that also did not report anything to the log.  This is someone off topic but that can be excused for a newbie, I'd like know if there is any way to force the result of a query to be reported to the log or even better to report the current value of a variable to the log.  It would seem important for many other types of applications to be able to log the current value of variables.  

Any help will be greatly appreciated.  (I don't know how my status was updated to "Advanced Member" but at best I'd classify myself as "Intermediate", and that might be  a push.)

You are correct that most things only get recorded in the log if they change.  The other thing to know, IIRC, is that only only state variable changes get written to the log (not integer variables).  So you could create a state variable that you use to pass values to the log.  Say you create a state variable called sLogVariable.  Then whenever you want to make sure that a device value gets recorded in the log you need to do two things.  First set sLogVariable=-5000 (or some other value you know the device will never report).  Then set sLogVariable = the selected device value.  By first setting it to -5000 you guarantee that when you next set it to the selected device value that you will be changing the value of the variable and thus it will appear in the log.  Later when you process the log, you simply ignore the -5000 value when you collect data.

Posted

Very good.  That's the key. Only state variables and only when they change get written to the log.  I guess that is covered in some document somewhere but I couldn't find it  Thanks.

 

Posted

kclenden, my little program still isn't recording changes to my state variables.  I forced the change in values as you suggested; I even just changed to value via two set variable lines in the code and still nothing in the log file.  I must be leaving out some step to enable logging or enable logging of my state variables.  

Posted
17 hours ago, Jimini said:

kclenden, my little program still isn't recording changes to my state variables.  I forced the change in values as you suggested; I even just changed to value via two set variable lines in the code and still nothing in the log file.  I must be leaving out some step to enable logging or enable logging of my state variables.  

Sorry about that.  You're not leaving out any steps.  I was out of town when I replied, and was going from memory, which unfortunately wasn't quite complete.  Changes to state variables are recorded to the Event Viewer but not the Log.  The Event Viewer can be saved to a file, but using it to log values over a long time wouldn't be practical as you'd have to leave it running on a computer for a long time.

Posted

Not a problem.  As you can see from the delay in my reply, that I only work on this ISY stuff in what spare time I can find.  I found this Event Viewer.  From my brief look at it, it appears to only run while I have the Admin Console running, at least the start of it's log was my launching of the console.  You are correct, that I don't really want to require the computer running all the time.  So it looks like I either use the system log and put up with only seeing changes to my temperature sensors, or I dig more into the Nodelink and see if that might provide a better logging system.  That again will be completely new territory for me to explore.  

Thanks.

Posted (edited)
On 9/11/2019 at 6:44 PM, Jimini said:

So it looks like I either use the system log and put up with only seeing changes to my temperature sensors, or I dig more into the Nodelink and see if that might provide a better logging system.

Turns out you have another option.  If you have the Network Module which can be purchased stand-alone OR comes with the ISY Portal Module, then you can CREATE/DELETE/APPEND TO files within the Web Server directory.  This would allow you to create your own log file.  From the wiki:

image.thumb.png.7cd2ccdb9fbef5fd9a1a4c7fb6388048.png

Edited by kclenden
  • Like 1
Posted

Thank you, kclenden, for this new information.  This option appears to be worth investigating further before I go in the Nodelink direction.  The Network module looked like something I might be interested in for the future when I first read the ISY Users Guide.  But can you point me to more information about the Nework module and the ISY Portal Module?  I see no information about the Portal Module in the Users Guide.  And it is not clear to me if these various optional modules  are extra hardware, firmware or software and how much they cost.  

Posted
5 hours ago, Jimini said:

But can you point me to more information about the Nework module and the ISY Portal Module?  I see no information about the Portal Module in the Users Guide.  And it is not clear to me if these various optional modules  are extra hardware, firmware or software and how much they cost.  

Information about the various modules can be found in the wiki:

 https://wiki.universal-devices.com/index.php?title=Main_Page#Add-On.2FOptional_Modules_for_the_ISY-994i

Both the ISY Portal Module and the Network Module are software.  You pay for them online and then can pretty much install them and begin using them instantaneously.

The ISY Portal is a subscription.  You pay $23 for the first two years and then $12 each year thereafter.  Once your subscription runs out, you no longer have access to the ISY Portal (or the Network Module that comes with it).

The Network Module is a one time payment of $49.  You have access to it until you choose to deactivate it.

Posted

Thanks again for the info. I understand the cost model, a bit tricky to decide the optimum path since I likely will only make use of the ISY Portal down the road a ways and that will require more investigation of whether one of the connection would give me access to my Apple TV or my BOSE house wide sound system.  Possible for the former but very unlikely for the latter.  

After a brief read of what you pointed me to, it appears that the software for the Network Module added to the Admin Console but somehow provides software added to the ISY programs I write so ultimately, I don't have to keep software running on my computer to log data or send email notices but can grab the logged data from ISY when I launch the Console.  Is that correct?  And can I create such a log such that the data can ultimately be fed to some form of spreadsheet such as Excel?  From the wiki, it wasn't clear to me what format the created files might take.

Posted (edited)
1 hour ago, Jimini said:

Thanks again for the info. I understand the cost model, a bit tricky to decide the optimum path since I likely will only make use of the ISY Portal down the road a ways and that will require more investigation of whether one of the connection would give me access to my Apple TV or my BOSE house wide sound system.  Possible for the former but very unlikely for the latter.  

After a brief read of what you pointed me to, it appears that the software for the Network Module added to the Admin Console but somehow provides software added to the ISY programs I write so ultimately, I don't have to keep software running on my computer to log data or send email notices but can grab the logged data from ISY when I launch the Console.  Is that correct?  And can I create such a log such that the data can ultimately be fed to some form of spreadsheet such as Excel?  From the wiki, it wasn't clear to me what format the created files might take.

The Network Resource module is already resident inside your ISY and only takes a key pushed down from UDI.. This usually happens within hours after payment and is arranged from inside the admin console. This will allow you to send Ethernet packets in almost any protocol to any Ethernet device. It also provides an extension to the email notifications that can provide basic database writes to memory inside ISY. 


Mwareman wrote some script that will run on another computer to scrape these files and display them in graphical form. I did some work on this also, breaking files down into this week, last week, week before files, to analyse event on my HVAC system. This helped me a lot to see where things went wrong with co-ordinated thermostats. I can't remember the file protocol but IIRC it was .CSV. The beauty of that system is that it is all existent inside your ISY and only required an external computer to see the finished data. That was a giant milestone in independence for us ISY freaks, anyway.

post-4697-0-38265300-1469900557_thumb.jpgpost-4697-0-51611000-1469902629_thumb.jpgpost-4697-0-72668900-1470070167_thumb.jpg

 

I couldn't live without ISY NRs anymore. I use them to control software in my RPi that runs 25 lightbulbs, it ran my Hue bridge, as well as MILight, and MagicHome RGBWW strip controllers. Now it also runs my Onkyo A/V receiver, selecting radio stations and switching to Netflix, Sat dish, BlueRay player etc..

Edited by larryllix
Posted

Thanks, larryllix, for the added information.  It does appear that I can use this to track my three temperature sensors over time with the actual read back values and not just when those values change as with the system log. If I can assign variables to the read back temperatures and put those periodically into a .csv file, I can do all I want with that, graphs, etc.  Next, I just have to decide if the likelihood of using the ISY Portal module is high enough to warrant getting both or just the Network Module alone.  Thanks again. 

Posted
1 hour ago, Jimini said:

Thanks, larryllix, for the added information.  It does appear that I can use this to track my three temperature sensors over time with the actual read back values and not just when those values change as with the system log. If I can assign variables to the read back temperatures and put those periodically into a .csv file, I can do all I want with that, graphs, etc.  Next, I just have to decide if the likelihood of using the ISY Portal module is high enough to warrant getting both or just the Network Module alone.  Thanks again. 

For me, the ISY Portal is really needed for Alexa and/or Google Home voice control. Without it I would be using manual switches and not have easy access to colour lighting schemes etc. Fancies like, turn on the TV, Turn on radioStationXXXX, etc... would take manual operation. Most times the switch is entering/leaving the room but all the Gathering Room scenes, like Reading Lights, TV lights, perimeter lights, Christmas Lights, etc... etc. are much easier with vocal control. That takes the ISY Portal. There re ways around it but it really smooths it out and makes it much easier. It also gives me remote access without punching holes in my router firewall and allows me to trigger voice snippet announcements out of Alexa boxes, from my ISY.

Posted

Yes, I can see the advantages of providing a connection between ISY and either Alexa or Google Home.  I don't yet use those but could consider adding one of those in the future.  The main downside of all that for me is that my music library is stored on a Mac computer which is connected to my Bose sound system through an Apple TV and the Bose system has audio outlets in six rooms of the  house in addition to the Dolby 5.1 surround sound system in the family room.  This Bose system is old enough that each room's audio is controlled by its own Bose remote.  Tying all this with the IFTTT interface seems unlikely.  I did look to see if IFTTT would connect to the Apple TV but asking the question did not yield an answer.  Given all this, unless I am overlooking something fundamental, I think the voice commands would likely be limited to lighting scenes, at least until I'm ready to replace my entire sound system and library storage.  But I do appreciate all the help understanding how all these pieces fit together.  

Guest
This topic is now closed to further replies.

×
×
  • Create New...