Average outside temperature with Lua

Moderator: leecollings

User avatar
jvdz
Posts: 2206
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Average outside temperature with Lua

Post by jvdz »

Knibor wrote: Tuesday 20 November 2018 20:19 Now I use the script for measure the "Gasverbruik per graaddag" in conjunction with the previous script "average temperature"

The following error is in the error log "

2018-11-20 20:17:00.475 Error: EventSystem: Lua script Gasverbuik per graaddag did not return a commandArray

What do I wrong?
This looks like a Dzevent script, not regular LUA script, which always needs the: "return commandArray" as it acts on the contents of that array.
Maybe some reading/studying is needed now to understand the different script options and how their basics work? ;)

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Knibor
Posts: 112
Joined: Sunday 20 May 2018 12:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: NL
Contact:

Re: Average outside temperature with Lua

Post by Knibor »

Thanks for the info Jos, its works now.
Time to learn a little bit more about scripting Lua and Dzvents
Hink
Posts: 1
Joined: Sunday 16 June 2024 17:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Average outside temperature with Lua

Post by Hink »

If you get this error:

[WebServer] Depricated RType (graph) for API request. Please use correct API Command!

I solved is by replacing:

Code: Select all

local sQuery = 'curl "http://127.0.0.1:8080/json.htm?type=graph&sensor=temp&idx='..tostring(uitlees_idx)..'&range=day"'
with

Code: Select all

local sQuery = 'curl "http://127.0.0.1:8080/json.htm?type=command&param=graph&sensor=temp&idx='..tostring(uitlees_idx)..'&range=day"'
User avatar
jvdz
Posts: 2206
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Average outside temperature with Lua

Post by jvdz »

Yep... things change after 6 years!
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests