Introducing Lua script for TellStick ZNet Lite

Using the Telldus Live! Events it is possible to create some really advanced scenarios. But sometimes this is not enough. To extend the possibilities further we are announcing Lua scripting support for TellStick ZNet Lite.

What us Lua?

Lua is a powerful, efficient, lightweight, embeddable scripting language. This means you can extend the functionality in TellStick ZNet Lite with your own code. Is can be as simple as turning a light on or off or maybe you want the adjust the reported value from a sensor? Maybe you want to use a wind sensor to calculate the real perceived temperature from a sensor? This can all be done with some simple Lua scripting.

How can I test it?

Currently we are working on documentation and examples for you. We need help with this. Please use the comments below and tell us what kind of script you would like to see. We will later open up the beta to everyone who wants to try once this is finished.

Comments

1. per jonsson <per@…> -- 2016-07-22 13:26

Would it be possible to use values from sensors in messages from events using this?

2. micke prag <micke.prag@…> -- 2016-07-22 17:33

Yes, that would be possible although sending messages is not supported from Lua. I will add it to the wish list.

3. mats knuts <mats@…> -- 2016-08-30 16:58

Would it be possible to use script to change the configuration of a zwave device (for example change the alarm behaviour)?

4. micke prag <micke.prag@…> -- 2016-08-31 10:20

@mats: This could maybe work. It is hard to answer this generic. Could you perhaps elaborate a bit more on what exactly you want to do?

5. fredrik töörn <fredrik@…> -- 2016-08-31 14:38

It would be nice to ping my network connected tv, if it replies you could set a state to TV on, if not TV off .

6. micke prag <micke.prag@…> -- 2016-08-31 15:04

@fredrik: Good idea. I have reported this to the developers.

7. mats knuts <mats@…> -- 2016-09-05 17:38

What I want to do (ref to comment 3) is to change a parameter in the configuration of a zwave device, on for example a Fibaro wall plug you can change the alarm behavior by changing parameter 34 and 35. This is possible to do manually using Telldus Live Web GUI, but I want to be able to automate it.

Another thing I want to do is to be able to compare two sensors and act on the difference between them. Today I control a pump that pumps pool water thrue a solar heating equippment and I want to have a sensor on the inlet and one on the outlet and turn of the pump if the outlet water temp isn't higher than the inlet water temp.

8. micke prag <micke.prag@…> -- 2016-09-05 17:42

@mats: Yes, both your requests would be possible. Although in the Z-Wave case this new parameter will not be sent until the device wakes up next time. This is a limitation in the Z-Wave system and not in Lua though...

9. cristian carlsson <cristian@…> -- 2016-09-19 20:42

Would like to do http get requests when a event is happening like light turns on, for triggering other stuff, would be nice to be able to call other http things locally at home so Internet isn't needed for events, I would like my setup to be locally managed..

A other thing would be to add own support for Scenes or/and alarms, would that be possible?

And for the burning question, when will the beta open, and where will it be announced, don't wanna miss this. I thought it already was in because of the documentation in the local api so I was a bit confused that my device got a 500 error on /lua url...

10. kristian karlefur <krika773@…> -- 2016-11-16 21:34

What is the state of the LUA scripting?

I would like to be able to read multiple sensor values at timed iterwalls eg every 10th minute composing a message (SMS/EMAIL/NOTIFICATION).

I would also like to trigger the action by a call to the local api from external source in the network

11. arne larsson <k.a.larsson@…> -- 2016-11-18 15:18

On my wish list I have this:

  • A general function for starting a Lua-script from outside
  • A function for starting a Lua-script from Telldus Live
  • Possibility to start a program outside of the sandbox/Tellstick from Lua
  • Possibility to trig an event in Telldus Live from Lua

With these functions and a good documentation, Tellstick/ Telldus Live would be a really powerful tool. Easy to use for everyone and with really high flexibility for experts.

Off cause, I am also interested to test the beta when it comes.

12. kim betti <kim.betti@…> -- 2016-11-28 17:45

Being able to make a http request with "socket.http" would be immensely useful!