Author Topic: New Plugin: SiteSensor  (Read 4960 times)

Offline rafale77

  • Hero Member
  • *****
  • Posts: 1104
  • Karma: +52/-21
Re: New Plugin: SiteSensor
« Reply #75 on: May 28, 2018, 03:57:39 am »
I see, I got it fixed by stopping openLuup and manually editing the json file. It was just the https problem. I was looking for the invalid "apps.mios" url which I could not find which is what confused me.
openLuup (94 devices, 122 scenes, 20 apps) controlling HomeAss + VeraPlus (133 zwave nodes, 8 Zigbee nodes, 202 devices, 34 scenes , 3 apps) Bridged to Homekit and Alexa

Offline Buxton

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +6/-0
Re: New Plugin: SiteSensor
« Reply #76 on: June 09, 2018, 08:02:41 pm »
I'm getting a startup error in the openLuup startup log.

Code: [Select]
2018-06-09 15:56:15.047   openLuup.chdev:: [string ""]:39: unexpected symbol near '}'
2018-06-09 15:56:15.047   luup.create_device:: [86] D_SiteSensor1.xml / I_SiteSensor1.xml / D_SiteSensor1.json

There were no errors during installation from the altApp store.  Current sitesensor is 1.6.  The program is installed and the UI appears functional, however, I tried to create a link to the https://api.sunrise-sunset.org as outlined in your blog post, but the plugin does not seem to respond. 

The values you suggested for this particular link were input into each field, (there are some misnamed fields in the blog description) and after a luup reload, the values persist, however the plugin does not appear to produce any result. 

I set to true constants for debug, altUI, and openLuup at the top of the sitesensor lua file.  After doing so and with a luup reload, I can see that setting the armed switch in the UI for the sensor creates a log entry, as does toggling log requests.  However there is still no visible action and the UI on the control tab reads tripped, without any of the other fields in the UI displaying information.

Hope all that helps.

edit  Request Timeout: should be 60, not 28000 and Request Interval should be listed --set for 28000
"Re-Evaluate Trip Expression" should be "Re-evaluate the expressions" and should read to set to a minute not seconds.
« Last Edit: June 09, 2018, 08:23:39 pm by Buxton »

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 395
  • Karma: +55/-0
Re: New Plugin: SiteSensor
« Reply #77 on: June 09, 2018, 08:51:13 pm »
Changing the debug constant will add more logging info. The two lines you posted don't help much. Post more log, or better yet, email it to me (email address on my profile).

Don't need to change isALTUI or isOpenLuup, these are managed by detection at startup.

You might ask @akbooer about the startup error. Although it's near the SiteSensor plugin load, and without more context, it's hard to discern what's going on there, but off-hand it doesn't look like a SiteSensor issue. And the fact that you say its logging things when you try to arm/disarm/etc. suggests the plugin started and you've got at least a somewhat running device.

It would also help to run this request and send me the output with the logs:

Code: [Select]
http://your-openluup-ip:3480/data_request?id=lr_SiteSensor&action=status
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 395
  • Karma: +55/-0
Re: New Plugin: SiteSensor
« Reply #78 on: June 09, 2018, 09:18:08 pm »
Oh, and if you are running the recent OpenLuup update with the new XML parser,  you need to install the "stable" version of SiteSensor.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline Buxton

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +6/-0
Re: New Plugin: SiteSensor
« Reply #79 on: June 09, 2018, 09:32:34 pm »
Yes, I'm running the test version of openLuup with the new XML parser.   Where is the "stable" version of SiteSensor?


Also getting a 501 error to the status command.

"No handler for data_request?id=lr_SiteSensor"
« Last Edit: June 09, 2018, 09:35:22 pm by Buxton »

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 395
  • Karma: +55/-0
Re: New Plugin: SiteSensor
« Reply #80 on: June 09, 2018, 10:08:54 pm »
If you go to the AltAppStore, you can choose the "stable" branch to install. See how that goes first.

Edit: correct from mobile
« Last Edit: June 10, 2018, 07:05:50 pm by rigpapa »
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline Buxton

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +6/-0
Re: New Plugin: SiteSensor
« Reply #81 on: June 09, 2018, 11:25:51 pm »
OK, installed the stable version (1.7 per the UI) and there are no error messages per the install, however, I'm still seeing the same error in the startup log.  There's also no change in behavior, however, I'm now seeing status updates in the openLuup log; these updates were not in the log while using version 1.6.  Here's a sample of the current log status:
Code: [Select]
2018-06-09 20:07:58.102   openLuup.http:: GET /luvd/D_SiteSensor1.xml HTTP/1.1 tcp{client}: 0x3dd553c8
2018-06-09 20:07:58.102   openLuup.http:: request completed (1671 bytes, 1 chunks, 0 ms) tcp{client}: 0x3dd553c8

I'm pretty sure the startup error message refers to this plugin as the time signatures are identical and the previous plugin loads and operates correctly.  BTW, out of ten plugins loaded, this is the only one giving me trouble....  Will see if AK can provide some debugging direction for "openLuup.chdev".

Offline akbooer

  • Master Member
  • *******
  • Posts: 5872
  • Karma: +251/-69
  • "Less is more"
Re: New Plugin: SiteSensor
« Reply #82 on: June 10, 2018, 03:06:22 am »
It's actually the loader module which needs DEBUG set to true.  If it's a new enough version it should create a file, DUMP_..., of the problem device.  The latest testing branch should actually report those two startup log lines in correct order (swapped in earlier versions.)  The error message itself comes from the Lua interpreter, so I can't improve on that.

Let me know if you need more.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 395
  • Karma: +55/-0
Re: New Plugin: SiteSensor
« Reply #83 on: June 10, 2018, 09:27:43 am »
@buxton, I do most of my development under openLuup, and it's working fine in my current environment, but I haven't upgraded to AK's latest and greatest. I've got other stuff on my agenda today but I'll try to get time to upgrade my install and look at it. Are you able to run that status query now that you're on 1.7?
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 395
  • Karma: +55/-0
Re: New Plugin: SiteSensor
« Reply #84 on: June 10, 2018, 06:24:08 pm »
@Buxton: version 1.7 works fine for me on the current testing branch of openLuup. I don't get any startup errors, and following the recipe on my web site for the civil twilight configuration works as described.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline Buxton

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +6/-0
Re: New Plugin: SiteSensor
« Reply #85 on: June 10, 2018, 07:26:17 pm »
OK.  I'll have to look closer at what's going on here then as it looks like the problem must be on my end (and it usually is :D).  The function that's conveying the error is "local function assemble_device_from_files (devNo, device_type, upnp_file, upnp_impl, json_file)" in the loader.lua module.

AK makes some observations about device files at the head of the function......

I'm not sure how to set a breakpoint in ZBS for a variable watch (upnp_impl == I_SiteSensor1.xml) as that's the only way I can imagine tracking this down.

As an aside, I typically see this  interpreter error when I spaceout and use "=" instead of "==",  a habit from using other languages  :)
« Last Edit: June 10, 2018, 07:28:02 pm by Buxton »

Offline Buxton

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +6/-0
Re: New Plugin: SiteSensor
« Reply #86 on: June 10, 2018, 07:40:33 pm »
I just updated openLuup to the most recent testing version and now sitesensor works!  Truly sorry for the trouble. I dislike wasting folk's time on such things.

I did do an update prior to trying to track down this error, but apparently something must have corrupted as the testing version of openLuup has the same id# as before.  Odd though that this was the only plugin effected.  Anyway, all is good.  Your code is beyond awesome BTW.

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 395
  • Karma: +55/-0
Re: New Plugin: SiteSensor
« Reply #87 on: June 10, 2018, 08:34:57 pm »
@buxton, that's good news! Just a reminder, double-check your plugin config for the civil twilight and make sure you have a long request interval (the post recommends 28800), and use the "Re-evaluate" flag set to "Every minute." This is an important point to not spam the server with queries for results that only change daily. Must be good netizens! :)
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline Buxton

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +6/-0
Re: New Plugin: SiteSensor
« Reply #88 on: June 10, 2018, 10:00:35 pm »
Yep, all is good.  I would correct your blogpost though as the request interval is mistaken for request time out.....  I can see how someone would swap the values causing real havoc.