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

Offline ustredna

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: New Plugin: SiteSensor
« Reply #30 on: February 07, 2018, 03:51:39 pm »
i have the same problem....
21:48:21: Requesting JSON data
21:48:21: GET http://www.stokercloud.dk/dev/getjsondriftdata.php?mac=hampl, headers={  }
21:48:21: Response HTTP status 200, body={"501":"38.3 °C flow","502":"0 % Power","503":"22 °C Shaft","504":"0 kW Power","505":"73.7 kg Hopper","506":"0 Lx Light","507":"Stopped clock ","508":"07/02-2018 21:47:58","521":"0 °C Return","522":"0 liter/hour Flow","524":"0 °C External temperature","525":"47 °C Temperature DHW","526":"16.5 % Actual oxygen","527":"0 % Target oxygen","528":"750 Gram auger/6 min","530":"18.683 kg Today","531":"0 kg/m2 Today","532":"0 °C Smoke temp.","533":"65 °C Target boiler temp.","534":"56 °C Target DHW temp.","542":" ","584":"Nitra ","585":"100 % humidity","586":"1011 hPa pressure","587":"3.1 m/s wind speed","588":"http://openweathermap.org/img/w/50n.png ","589":"1 °C air temperature","591":"10 null","592":"0.0 °C T5","alarm":"0"}

21:48:21: Failed to execute `response."507"', { location=10, type="evaluation", source="LuaXP", message="Invalid subreference" }
21:48:21: Eval #1: response."507"=(nil)nil
21:48:21: Failed to execute `response."504"', { location=10, type="evaluation", source="LuaXP", message="Invalid subreference" }
21:48:21: Eval #2: response."504"=(nil)nil
21:48:21: Failed to execute `response."501"', { location=10, type="evaluation", source="LuaXP", message="Invalid subreference" }
21:48:21: Eval #3: response."501"=(nil)nil
21:48:21: Failed to execute `response."506"', { location=10, type="evaluation", source="LuaXP", message="Invalid subreference" }
21:48:21: Eval #4: response."506"=(nil)nil
21:48:21: Failed to execute `response."505"', { location=10, type="evaluation", source="LuaXP", message="Invalid subreference" }
21:48:21: Eval #5: response."505"=(nil)nil
21:48:21: Failed to execute `response."525"', { location=10, type="evaluation", source="LuaXP", message="Invalid subreference" }
21:48:21: Eval #6: response."525"=(nil)nil
21:48:21: Failed to execute `response."alarm"', { location=10, type="evaluation", source="LuaXP", message="Invalid subreference" }
21:48:21: Eval #7: response."alarm"=(nil)nil
21:48:21: Failed to execute `response."alarm" = 1', { location=10, type="evaluation", source="LuaXP", message="Invalid subreference" }
21:48:21: Eval trip expression: response."alarm" = 1=(nil)nil
21:48:21: Next activity in 60 seconds


before 3 days working fine, but now with errors.
Query is ok but expression error...

is any solution ???????

please help

Peter

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 462
  • Karma: +65/-0
Re: New Plugin: SiteSensor
« Reply #31 on: February 07, 2018, 05:19:41 pm »
Try the response["507"] form
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 rafale77

  • Hero Member
  • *****
  • Posts: 1157
  • Karma: +52/-22
Re: New Plugin: SiteSensor
« Reply #32 on: February 09, 2018, 09:49:28 pm »
Updated to the latest github on openluup and I am having another problem. it looks like you have a naming problem with the controlpanel function. It is called "SiteSensor.controlPanel" in the json file while that function does not exists in the js file. There the function is only called "controlPanel" so I am getting this error:

Code: [Select]
an error occurred while displaying the javascript tab. devid: 0-20 err:SiteSensor.controlPanel is not a function. (In 'SiteSensor.controlPanel(20)', 'SiteSensor.controlPanel' is undefined)
openLuup (97 devices, 134 scenes, 20 apps) controlling HomeAss + VeraPlus (131 zwave nodes, 8 Zigbee nodes, 199 devices, 20 scenes , 2 app) Bridged to Homekit and Alexa

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 462
  • Karma: +65/-0
Re: New Plugin: SiteSensor
« Reply #33 on: February 10, 2018, 07:46:53 am »
It's an exported function of the module, so it is addressed by its module name. I suspect you don't have the latest UI7 JS file. You need to install both files. The UI7 file is used both for UI7 and ALTUI.
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 rafale77

  • Hero Member
  • *****
  • Posts: 1157
  • Karma: +52/-22
Re: New Plugin: SiteSensor
« Reply #34 on: February 10, 2018, 12:01:02 pm »
Hmm it looks like it was a browser cache problem. Tried from another computer and I am not seeing the same error.
openLuup (97 devices, 134 scenes, 20 apps) controlling HomeAss + VeraPlus (131 zwave nodes, 8 Zigbee nodes, 199 devices, 20 scenes , 2 app) Bridged to Homekit and Alexa

Offline s4nup

  • Sr. Newbie
  • *
  • Posts: 44
  • Karma: +0/-1
Re: New Plugin: SiteSensor
« Reply #35 on: February 15, 2018, 09:07:48 am »
Hi

Had this working correctly, but am also now getting the "Query OK, but 1 expressions failed" error message

This is the output of my HTTP Request:

{"cleanMissionStatus":{"cycle":"none","phase":"charge","expireM":0,"rechrgM":0,"error":0,"notReady":0,"mssnM":20,"sqft":154,"initiator":"alexa","nMssn":40},"pose":{"theta":162,"point":{"x":213,"y":-31}},"bin":{"present":true,"full":false},"batPct":100}

My query is:
response.cleanMissionStatus.cycle to which the response is currently : none

My Trip expression is response.cleanMissionStatus.cycle = "none" to which i am getting the following in the log:
Code: [Select]
14:05:02: Failed to execute `response.cleanMissionStatus.cycle = "none"', { location=35, __source="luaxp", message="Invalid assignment", type="evaluation" }
14:05:02: Eval trip expression: response.cleanMissionStatus.phase="charge"=(nil)nil

As i said, this was working correctly before, but now its not. What am i doing wrong??

Offline tomtcom

  • Hero Member
  • *****
  • Posts: 956
  • Karma: +21/-31
Re: New Plugin: SiteSensor
« Reply #36 on: February 15, 2018, 06:30:46 pm »
The linked page describes the interface between the doorbell and Ring's servers. While you could mimic the doorbell's requests to Ring, I'm not sure it would get you much, as the most interesting things to do here seem to revolve around initiating the SIP connection between the doorbell (as originator) and the server (as gateway), and if initiated by SiteSensor on the Vera, the usual originator (doorbell) likely would not be in a state where it would know to complete the connection.

I'm not a Ring user yet. I got my wife one for Christmas, so in a couple of days I surely will be. Maybe once that happens, I can try it and see what surprises come out of it.

Thanks, I have a lot of interest too as a Ring user. Vera's official stance is they won't integrate half of the device meaning Ring won't expose the video portion and Vera stopped talking about it. Many said it did not matter (including myself) as we wouldn't use Vera for video but a real integration of the events such as the door bell ringing and the motion notification. Those can easily trigger scenes and everyone would use the video from the Ring app itself.

Hi Rigpapa, in the post above you said you got your wife a Ring for Christmas. With sitesensor work moving along, I'm wondering how I could assist in helping to test if we could capture the motion events for use in Vera or if someone has rang the bell? We do not need the video in Vera but the ability to tie into the events to trigger actions on like turning on a light when Ring has motion.

Thanks!

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 462
  • Karma: +65/-0
Re: New Plugin: SiteSensor
« Reply #37 on: February 15, 2018, 07:06:31 pm »
There seem to be other better integrations in the works, and I've been busy with some other plugins, so I haven't taken the time yet to look and don't have a ton of motivation to do so at the moment. I'm kind of hoping that Vera themselves does something, or we end up with a solution through other channels that are gaining traction (IFTTT or MQTT?).
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 tomtcom

  • Hero Member
  • *****
  • Posts: 956
  • Karma: +21/-31
Re: New Plugin: SiteSensor
« Reply #38 on: February 15, 2018, 08:57:52 pm »
There seem to be other better integrations in the works, and I've been busy with some other plugins, so I haven't taken the time yet to look and don't have a ton of motivation to do so at the moment. I'm kind of hoping that Vera themselves does something, or we end up with a solution through other channels that are gaining traction (IFTTT or MQTT?).

Thanks but I haven't heard of any others. Vera said no to the ring because they couldn't get the video portion and the Wink plugin has been withdrawn. IFTTT beta has also been no activity for months from the Vera side.

If you know of anything else, please let me know and I'll investigate.

Offline s4nup

  • Sr. Newbie
  • *
  • Posts: 44
  • Karma: +0/-1
Re: New Plugin: SiteSensor
« Reply #39 on: February 16, 2018, 09:13:15 am »
Any guidance to the following??

Thanks
Hi

Had this working correctly, but am also now getting the "Query OK, but 1 expressions failed" error message

This is the output of my HTTP Request:

{"cleanMissionStatus":{"cycle":"none","phase":"charge","expireM":0,"rechrgM":0,"error":0,"notReady":0,"mssnM":20,"sqft":154,"initiator":"alexa","nMssn":40},"pose":{"theta":162,"point":{"x":213,"y":-31}},"bin":{"present":true,"full":false},"batPct":100}

My query is:
response.cleanMissionStatus.cycle to which the response is currently : none

My Trip expression is response.cleanMissionStatus.cycle = "none" to which i am getting the following in the log:
Code: [Select]
14:05:02: Failed to execute `response.cleanMissionStatus.cycle = "none"', { location=35, __source="luaxp", message="Invalid assignment", type="evaluation" }
14:05:02: Eval trip expression: response.cleanMissionStatus.phase="charge"=(nil)nil

As i said, this was working correctly before, but now its not. What am i doing wrong??

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 462
  • Karma: +65/-0
Re: New Plugin: SiteSensor
« Reply #40 on: February 16, 2018, 09:15:38 am »
Your trip expression is actually being an assignment, not a comparison. Use the "==" operator rather than single "=".
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 tunnus

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +0/-0
Re: New Plugin: SiteSensor
« Reply #41 on: February 28, 2018, 12:11:02 pm »
Was wondering if this plugin could be used to get electricity price data from a site (https://www.nordpoolgroup.com/Market-data1/Dayahead/Area-Prices/FI/Hourly/?dd=FI&view=table) and then use the data in PLEG?

Another option would be to use lua code, but not sure how it would be done. A draft below

Code: [Select]
local https = require("ssl.https")
local ltn12 = require("ltn12")
-- 5 Second timeout
https.TIMEOUT = 5
 
  local response_body = {}
  local request_body = ''
 
  local r, c, h = https.request{
    url = 'https://https://www.nordpoolgroup.com/Market-data1/Dayahead/Area-Prices/FI/Hourly/?dd=FI&view=table',
    method = "GET",
    headers = {
      ["Content-Length"] = string.len(request_body),
      ["Content-Type"] = "application/x-www-form-urlencoded"
    },
    source = ltn12.source.string(request_body),
    sink = ltn12.sink.table(response_body)
  }

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 462
  • Karma: +65/-0
Re: New Plugin: SiteSensor
« Reply #42 on: February 28, 2018, 02:03:18 pm »
Not directly in the form given at the URL in your code (which contains an error--two https protocol specs in a row). There is an API you can sign up for, here: https://www.nordpoolgroup.com/TAS/api/

...but... the day-ahead API call (which is free, apparently) comes back in XML, and SiteSensor currently does plain text and JSON only, no XML as yet. I would be happy to look at XML parsing though, but it's not something I can commit to supporting tomorrow, or likely even next week.

If we could get JSON, then SiteSensor could do what you want immediately (grab the data, pass it to PLEG). That API just doesn't do JSON for that data.

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.

Online akbooer

  • Master Member
  • *******
  • Posts: 5958
  • Karma: +258/-69
  • "Less is more"
Re: New Plugin: SiteSensor
« Reply #43 on: February 28, 2018, 02:26:55 pm »
There's a simple xml coder/encoder as part of openLuup.  If you've got an example of the response XML, then I could see if it's up to the job.

Or if that's not the issue, just say so!
« Last Edit: February 28, 2018, 04:50:00 pm by akbooer »
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: 462
  • Karma: +65/-0
Re: New Plugin: SiteSensor
« Reply #44 on: February 28, 2018, 03:03:37 pm »
No, the issue is that the output of that parser is usable for us programmers but a nightmare for anyone else, and I'm pretty sure that most users will not have an easy go figuring out how to map the resulting data into an expression that gets them the values they want reliably. That then, makes it turn into a support nightmare for me.
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.