Code: Select all
domoticz.sendCommand('Security Panel', domoticz.SECURITY_ARMEDHOME)
Code: Select all
domoticz.setSecurity(domoticz.SECURITY_ARMEDHOME)
Moderator: leecollings
Code: Select all
domoticz.sendCommand('Security Panel', domoticz.SECURITY_ARMEDHOME)
Code: Select all
domoticz.setSecurity(domoticz.SECURITY_ARMEDHOME)
Code: Select all
2016-07-20 00:20:26.868 LUA: Handling events for: "Vardagsrum Golvlampa 1", value: "Off"
2016-07-20 00:20:26.868 LUA: =====================================================
2016-07-20 00:20:26.868 LUA: >>> Handler: test
2016-07-20 00:20:26.868 LUA: >>> Device: "Vardagsrum Golvlampa 1" Index: 18
2016-07-20 00:20:26.869 LUA: .....................................................
2016-07-20 00:20:26.869 LUA: .....................................................
2016-07-20 00:20:26.869 LUA: <<< Done
2016-07-20 00:20:26.869 LUA: -----------------------------------------------------
2016-07-20 00:20:26.869 LUA: [1] = SendNotification: Hey!#I am off!#0#pushover
2016-07-20 00:20:26.869 LUA: =====================================================
2016-07-20 00:20:27.110 Error: GCM
DId not seem to work, only got the GCM error errordannybloe wrote:Good question I think you can do it like this:
Maybe you can check this then I can make a dedicated command like:Code: Select all
domoticz.sendCommand('Security Panel', domoticz.SECURITY_ARMEDHOME)
Or something like that.Code: Select all
domoticz.setSecurity(domoticz.SECURITY_ARMEDHOME)
Code: Select all
print(currentPath, scriptsFolderPath)
2016-07-20 11:09:26.463 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_device_main.lua: /home/pi/domoticz/scripts/lua/script_device_main.lua:11: module 'EventHelpers' not found:dannybloe wrote:Would be nice if Google could help you with this one
Anyway, weird... can you put the following code between line 3 and 4 in script_device_main.lua:
And see what it prints.Code: Select all
print(currentPath, scriptsFolderPath)
I resolved my problem!!! It was an directory structure issue.dannybloe wrote:Well, that looks good. Seems like Lua cannot find the files. Are you sure that all the files in /home/pi/domoticz/scripts/lua/dzVents are there and accessible by the Domoticz process (in my Pi setup they have pi:pi permissions instead of root).
As you can see in your trace it looks in the right places for the files: no file '/home/pi/domoticz/scripts/lua/dzVents/EventHelpers.lua'
That is exactly the correct path so if it cannot find it, it either isn't there or it doesn't have read access.
Can't you make the esp send a status report as well so it also controls a virtual switch? I have an esp that does just that. I think I connected one of the outputs to an input that controls a virtual switch (with proper resistors or transistors and stuff, don't know from the top of my head). Then you can use that to re-issue the command through a script if the device is not in the desired state after you send the command. In that case you can keep sending the command until it is ok.NietGiftig wrote:I have a couple of SonOff devices (ESP8266 driven with ESPEasy)
Every now or then (about 2 times the last 2 weeks) the device does not respond to a Domoticz command.
It's the Hall Light (in dutch portieklicht) and the neighbors complain
The device is a virtual device controlled by a dzVents script and is only a receiving device.
In the log I find.
Error opening url: http://192.168.0.201/control?cmd=GPIO,12,1
So it is sometimes not responding on that particular command at that moment.
I've seen some example scripts for check for dead devices, but the scripts assume that the device is regular sending data.
do I have to make the device sending some "I'm alive" data?
Even then I'm not sure if the device is responding to the on/off signal, because other days it reacts on the command.
Is it possible in dzVents (or LUA) to check the log after sending the on/off command for an error and send the command again?
Or is there another way to receive the error message in dzVents (LUA)
Or has somebody a waterproof method?
Seems to be like that.dannybloe wrote:What is the standard commandArray command then to arm the system?
Code: Select all
commandArray['Security Panel'] = 'Arm Away'
Yeah, you shouldn't have.dhanjel wrote:just moved my entire domoticz-installation from a linux to a windows machine (don´t ask me why ) and copied the .db file.
Everything works, except dzVents.
script_device_main.lua:3: attempt to concatenate local 'currentPath'
any ideas?
It also uses sed (sort string search and replace). Look inside the file utils.lua. There the fetching stuff is. There are just a couple of places where there is some path juggling to get the modules loaded. It does check for what kind system it is running by inspecting the path separator. It's not that magical. Maybe you can have a look if you dare todhanjel wrote:I was planning to use another computer for domoticz but my plans got ruined and I don´t have the energy to move back
anything more than curl? ´cause that can be installed
I'm not really sure what you exactly want to accomplish. Can you sketch/describe how you would want the script to behave? What do you mean by 'if the status of the switch light change'? Is that when the switch is operated physically?pluggin wrote:Some time ago a wrote a post with a issue I have with domoticz and light switchs (http://www.domoticz.com/forum/viewtopic ... 622#p90622). I upgraded to 3.5446 version but the issue persist so I think may be I can resolve it with Dzvents but I need help.
The symptom are:
The switchlight shows, Data and Status as ON but thats not true the light is really on OFF status. The device have current watt usage too and its 0.0 watt value thats confirm the OFF status.
Querying with json:
DEVICE Switch
{
"result" : [
{
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "On",
"HardwareID" : 2,
"HardwareTypeVal" : 21,
"HaveDimmer" : true,
"HaveGroupCmd" : true,
"HaveTimeout" : false,
"ID" : "00000701",
"Image" : "Light",
"IsSubDevice" : false,
"LastUpdate" : "2016-08-08 14:47:33",
"Level" : 255,
"Name" : "Luz pasillo",
"Notifications" : "false",
"PlanID" : "6",
"PlanIDs" : [ 6 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"Status" : "On",
"SubType" : "Switch",
"SwitchType" : "On/Off",
"SwitchTypeVal" : 0,
"Timers" : "false",
"Type" : "Light/Switch",
"idx" : "35"
}
],
}
Electric status
{
"result" : [
{
"BatteryLevel" : 255,
"Data" : "0.0 Watt",
"HardwareID" : 2,
"HardwareTypeVal" : 21,
"HaveTimeout" : true,
"ID" : "0000701",
"LastUpdate" : "2016-08-08 14:47:32",
"Name" : "Consumo Pasillo PB",
"Notifications" : "false",
"PlanID" : "5",
"PlanIDs" : [ 5 ],
"Protected" : false,
"ShowNotifications" : true,
"SubType" : "Electric",
"Timers" : "false",
"Type" : "Usage",
"TypeImg" : "current",
"idx" : "36"
}
],
}
What I want to do with dzvents if is the status of any of the switch light change to ON but the watt is 0 change it automaticaly to OFF state with a single script for any of the lightswitch. The script have to know that the switch light have a watt value to look at.
Is this posible?
Kind regards
Users browsing this forum: No registered users and 0 guests