Dummy switch won't turn on

Moderator: leecollings

Post Reply
tapas
Posts: 16
Joined: Thursday 18 May 2017 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Dummy switch won't turn on

Post by tapas »

Hello, I've been pulling my hair off over this seemingly very simple script that should turn a dummy switch (idx 22) on:

Code: Select all

commandArray = {}
commandArray['UpdateDevice'] = '22|1|On'
I'm trying to run it from linux shell lua script.lua with no luck, what am I missing?
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Dummy switch won't turn on

Post by pvm »

It seems to be missing
'return commandArray'

For examples check the wiki
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
tapas
Posts: 16
Joined: Thursday 18 May 2017 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dummy switch won't turn on

Post by tapas »

Thanks for the reply, I added that but still no luck :(
mivo
Posts: 80
Joined: Friday 21 April 2017 8:58
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Czechia
Contact:

Re: Dummy switch won't turn on

Post by mivo »

tapas wrote:I'm trying to run it from linux shell lua script.lua with no luck, what am I missing?
Hi,

starting LUA script from Linux shell will not work, there is no Domoticz API available. You should create script in designated folder and correct name - in subfolder of domoticz installation: scripts/lua. Then scrips are started by Domoticz event system.

Look at this, there are good examples:
https://www.domoticz.com/wiki/Events#By ... ion_folder.
My toys:
Raspberry Pi 3 + UPS PIco HV3.0 A Stack
Minibian (Raspbian Jessie) + Domoticz beta
RFLink 433 Gateway, 1wire DS18B20 temp sensors (GPIO)
RaZberry module + 2x Comet Z-Wave + Z-wave socket
---
Plugins: WeMo Switch, UPS PIco HV3.0A on GitHub
tapas
Posts: 16
Joined: Thursday 18 May 2017 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dummy switch won't turn on

Post by tapas »

mivo wrote:
tapas wrote:I'm trying to run it from linux shell lua script.lua with no luck, what am I missing?
Hi,

starting LUA script from Linux shell will not work, there is no Domoticz API available. You should create script in designated folder and correct name - in subfolder of domoticz installation: scripts/lua. Then scrips are started by Domoticz event system.

Look at this, there are good examples:
https://www.domoticz.com/wiki/Events#By ... ion_folder.
Yes, it works now, thank you! One of my problem was that script names were wrong. Should have read that wiki better.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest