Page 1 of 1
Script block - need help to virtual switch
Posted: Thursday 16 June 2016 8:12
by piokuc
Hi
I have a problem with block script. I have virtual switch name "okk" and phisical switch control by RFLink name "Szafa LEDy". I want to set virtual switch "okk" to status ON when i turn on switch "Szafa LEDy" also ON. But when try i have an error in logs:
Code: Select all
2016-06-16 07:38:05.407 Error: EventSystem: Device no. '74' used in event 'test_1' no longer exists, disabling event!
I dont know why. Please help.
It is my devices and script:

Re: Script block - need help to virtual switch
Posted: Thursday 16 June 2016 8:52
by StanHD
Seems it can't find device ID 74, but I can see it is there.
You could try deleting the Blockly event, delete the "okk" switch, then create a new virtual switch using the "Create Virtual Sensors" button in the Virtual Hardware, under the hardware tab. Then re-build your blockly event and try again?

Re: Script block - need help to virtual switch
Posted: Thursday 16 June 2016 8:54
by piokuc
I've done this a few times already and I did exactly as written, creating a virtual switch Hardwear
I test it also on other Domoticz and problem is the same.
Re: Script block - need help to virtual switch
Posted: Thursday 16 June 2016 12:24
by StanHD
Ah, OK, it's just that I noticed the type of switch on your device list is "Lighting 2 AC".
When I create using above method I get type "Light/Switch Switch".
Just a thought, is your "Real" switch a dimmer? Because if that's the case then you need to use "Not Off", as a dimmer works on "Level" and not "On".

Re: Script block - need help to virtual switch
Posted: Thursday 16 June 2016 13:13
by piokuc
No my switch is no dimmer. It is switch ON/OFF
I also has virtual switch IDX 73 which is type Light/Switch(look on my screen list) and on this working ok. Thenak. Type must be LIGHT/SWITCH
But i want also use this script to switch CONTACT. I change my switch IDX 73 to CONTACT and change in script block command open and close and it not working. What type virtual switch i must use to create switch contact to change it status form open to closed and agani to open etc. ?

Re: Script block - need help to virtual switch
Posted: Friday 17 June 2016 11:31
by piokuc
I done next text on latest beta version 3.5254
I create Virtual Device name "test" and set it as light/switch and then change to conntact. I have device zwave name "Ośw. pompa". I done event looks below. But when turn ON device "Ośw. pompa" and it has status ON , it not change status device "test" to status OPEN. Still has CLOSED. But if we look on block event when "Ośw. pompa" has status ON it should change status "test" to OPEN, but when "ośw pompa" has status OFF it should change "test" to CLOSED. But it not working. Why ?
http://fotoo.pl/show.php?img=1111271_device.jpg.html
http://fotoo.pl/show.php?img=1111272_event.jpg.html
http://fotoo.pl/show.php?img=1111273_desk.jpg.html
Re: Script block - need help to virtual switch
Posted: Friday 17 June 2016 12:18
by StanHD
Do you have other events working?
Is the event marked as enabled in the editor?
Re: Script block - need help to virtual switch
Posted: Friday 17 June 2016 12:43
by piokuc
I have only one event. Event is eneabled in Domoticz.
In log show this:
Code: Select all
2016-06-17 11:14:42.410 OpenZWave: Domoticz has send a Switch command! NodeID: 7 (0x07)
2016-06-17 11:14:42.427 EventSystem: Event triggered: test_1
2016-06-17 11:14:42.411 (Z-Wave) Light/Switch (Ośw. pompa)
2016-06-17 11:45:15.903 User: admin initiated a switch command
2016-06-17 11:45:15.904 OpenZWave: Domoticz has send a Switch command! NodeID: 7 (0x07)
2016-06-17 11:45:15.930 EventSystem: Event triggered: test_2
2016-06-17 11:45:15.905 (Z-Wave) Light/Switch (Ośw. pompa)
But when i change type vistual switch to ON/OFF and correct in event status for "test" it works ok. Can you test on your system Domoticz ?
I need create script to combinate two device with two other UNIT to one device status in Domoticz...
I use ELMES Switch Contact connected to RFLink and it has two UNIT. I need connect it to one device in domoticz by scripting.
Status OPEN has UNIT 4 but status CLOSED has UNIT 12.
Re: Script block - need help to virtual switch
Posted: Friday 17 June 2016 16:55
by StanHD
Hi, I have checked this on my system, and I agree that as a type "Contact", this will not work. As type "On/OFF" it does work.
Can you not just use the On/Off version? I'm sorry but I do not understand what you are trying to do, I'm sure there must be a way

Re: Script block - need help to virtual switch
Posted: Friday 17 June 2016 17:01
by piokuc
I want use it for my windows contact switch. I have device name Elmes which work on 433MHz but in new fw in RFLink it is recognized as two other devices with other UNIT for open and closed. Has unit 4 and 12. And i want by virtual device merged it to show status open and closed in one device.
Wysłane z mojego Galaxy S6 za pomocą Tapatalk
Re: Script block - need help to virtual switch
Posted: Friday 17 June 2016 17:13
by StanHD
OK, so I have Velux windows that need pulsed signals to control:-
Switch 1 = On for 1 second to Close
Switch 2 = On for 1 second to Open
Switch 1 & 2 = On for 1 second to Stop
Is this similar to your situation?
Re: Script block - need help to virtual switch
Posted: Friday 17 June 2016 20:56
by piokuc
No no i have switch contact.
After connect to RFLink to Domiticz, in domoticz was found one device show status open and second device show status closed. Open has UNIT 4 in devices but closed has UNIT 12 in devices in Domoticz. I want configure it to show status open and close in one virtual device.
Wysłane z mojego Galaxy S6 za pomocą Tapatalk