Some lua help

Hi
Does anyone know how to report their temperature to an external server.
Before I had Domotics on a Raspberry pi and then I ran a script that looked like this.

[code]commandArray = {}

commandArray[‘OpenURL’]=‘http://www.temperatur.nu/rapportera.php?hash=7e1492xxxXxxxxxxxxXxx5cc1aae1&t=’ … string.format(“%.2f”, otherdevices_temperature[‘Ute’])

return commandArray[/code]

Now I do not know how I should do to continue with my reporting.

Anyone?

Sent from my iPad using Tapatalk HD

Hi Johan71,

in Lua/Luup you probably want to use

luup.inet.wget(myUrl)
  • If you report at certain time intervals, then create a scene and add the Lua code inside the scene.
    You’d have to use luup.variable_get() to get the variabel value at the time.

Here’s some general programming info: [url=http://wiki.micasaverde.com/index.php/Luup_Scenes_Events]http://wiki.micasaverde.com/index.php/Luup_Scenes_Events[/url]

  • If you want to report each time a variable changes, then you’d have to add the Lua code to the Startup Lua

Take a look here, maybe that helps you with calling the external URL:
[url=http://forum.micasaverde.com/index.php/topic,16713.msg153469.html#msg153469]http://forum.micasaverde.com/index.php/topic,16713.msg153469.html#msg153469[/url]