Ultimate NOOB question: Unexpected symbol '}' near '<eof>'  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by Sjonnie2017 »

Hi All,

Let me start off by stating I have the coding skills of a kangaroo :oops: but I am willing to get into it :)

I am trying to create a simple script that will allow me to control my roller shutter (or Venetian blinds) with a simple switch. I thought I followed the wiki to the letter but I get an error I cannot seem to fix.

The roller shutter is working in Domoticz.

Both roller shutter module and switch use the Zigbee protocol but I cannot create a working scene in Phoscon. Hence LUA/DzVents.

The error I get is
Unexpected symbol '}' near '<eof>'
This is the script:

Code: Select all

--Control Zigbee roller shutter module QS-ZIGBEE-C01 with additional switch (IKEA E1743)
--IDX roller shutter module: 274
--IDX roller shutter module eettafel (for testing purposes): 77
--IDX IKEA switch: 291 ; Name: Conbee2 - Schakelaar Woonkamer 2

return {
    
	on = {
		devices = { 'ConBee2 - Schakelaar Woonkamer 2'}
	},
	
	execute = function(domoticz, roomSwitch)
	    if (roomSwitch.active) then
	        domoticz.devices(77).switchOn()
	end

}
I tried adding another line to the file and removed all unnecessary comments to no avail.

It is probably stupidly simple but I just can't get my head around it.

Any pointers greatly appreciated!

Greetz,

Sjonnie
Last edited by Sjonnie2017 on Saturday 13 February 2021 16:29, edited 2 times in total.
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by waaren »

Sjonnie2017 wrote: Sunday 07 February 2021 17:09
Any pointers greatly appreciated!
Your if block is missing an end

the end you have now, does mark the end of the execute function.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by Sjonnie2017 »

Hi Waaren,

Thanks! That resolved the error!

Unfortunately the script is not working. I must be doing something wrong but I can't find out what. If I trigger the switch that specific action is logged but nothing happens.
2021-02-07 17:30:01.693 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 0, 'sValue': 'Off'}
2021-02-07 17:30:01.794 (Zonnepanelen) Updated 2 values out of 16
2021-02-07 17:30:03.020 (ConBee2) onMessage called
2021-02-07 17:30:03.021 (ConBee2) ### WebSocket Data : {'attr': {'id': '16', 'lastannounced': None, 'lastseen': '2021-02-07T16:30Z', 'manufacturername': 'eWeLink', 'modelid': 'SA-003-Zigbee', 'name': 'Schakelaar Kelder Achter', 'swversion': None, 'type': 'Unknown', 'uniqueid': '00:12:4b:00:1c:d5:ff:78-01'}, 'e': 'changed', 'id': '16', 'r': 'lights', 't': 'event', 'uniqueid': '00:12:4b:00:1c:d5:ff:78-01'}
I hate to call upon your experience and knowledge again but do you have any idea what is missing in my script/logic?

Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by waaren »

Sjonnie2017 wrote: Sunday 07 February 2021 17:37 do you have any idea what is missing in my script/logic?
Not yet. But a first step is to set the script to log some more and check the log.

Code: Select all

--Control Zigbee roller shutter module QS-ZIGBEE-C01 with additional switch (IKEA E1743)
--IDX roller shutter module: 274
--IDX roller shutter module eettafel (for testing purposes): 77
--IDX IKEA switch: 291 ; Name: Conbee2 - Schakelaar Woonkamer 2

return
{

    on =
    {
        devices =
        {
            'ConBee2 - Schakelaar Woonkamer 2',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG,
        marker = 'roomSwitcher',
    },

    execute = function(dz, item)

        if item.active then
            dz.devices(77).switchOn()
        end

        item.dump()
        dz.log(item.state, dz.LOG_DEBUG)
    end
}

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by Sjonnie2017 »

Hi waaren,

Thank you for your continued support!

I copied your code to replace my "script" and pressed the button on the remote. This is what the log shows:

Code: Select all

2021-02-07 18:49:02.791 (ConBee2) onMessage called
2021-02-07 18:49:02.791 (ConBee2) ### WebSocket Data : {'e': 'changed', 'id': '35', 'r': 'sensors', 'state': {'buttonevent': 2001, 'lastupdated': '2021-02-07T17:49:02.743'}, 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:b3:ad:b4-01-1000'}
2021-02-07 18:49:02.792 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 0, 'sValue': 'Off'}, IGNORED , no changes !
2021-02-07 18:49:02.993 (ConBee2) onMessage called
2021-02-07 18:49:02.993 (ConBee2) ### WebSocket Data : {'e': 'changed', 'id': '35', 'r': 'sensors', 'state': {'buttonevent': 2003, 'lastupdated': '2021-02-07T17:49:02.952'}, 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:b3:ad:b4-01-1000'}
2021-02-07 18:49:02.994 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 40, 'sValue': '40'}
2021-02-07 18:49:03.812 (ConBee2) onHeartbeat called
2021-02-07 18:49:03.813 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 0, 'sValue': 'Off'}
2021-02-07 18:49:05.691 (ConBee2) onMessage called
2021-02-07 18:49:05.692 (ConBee2) ### WebSocket Data : {'attr': {'id': '22', 'lastannounced': None, 'lastseen': '2021-02-07T17:49Z', 'manufacturername': '_TZ3000_vd43bbfq', 'modelid': 'TS130F', 'name': 'Rolluik secretaire', 'swversion': '0xFFFFFFFF', 'type': 'Window covering device', 'uniqueid': '84:71:27:ff:fe:c4:61:0b-01'}, 'e': 'changed', 'id': '22', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:c4:61:0b-01'}
2021-02-07 18:49:05.692 Error: (ConBee2) Unknow MAJ{'attr': {'id': '22', 'lastannounced': None, 'lastseen': '2021-02-07T17:49Z', 'manufacturername': '_TZ3000_vd43bbfq', 'modelid': 'TS130F', 'name': 'Rolluik secretaire', 'swversion': '0xFFFFFFFF', 'type': 'Window covering device', 'uniqueid': '84:71:27:ff:fe:c4:61:0b-01'}, 'e': 'changed', 'id': '22', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:c4:61:0b-01'}
2021-02-07 18:49:06.371 (Zonnepanelen) Updated 2 values out of 16
2021-02-07 18:49:07.074 (ConBee2) onMessage called
2021-02-07 18:49:07.075 (ConBee2) ### WebSocket Data : {'attr': {'id': '35', 'lastannounced': None, 'lastseen': '2021-02-07T17:49Z', 'manufacturername': '_TZ3000_vd43bbfq', 'modelid': 'TS130F', 'name': 'Rolluik Hobby Water', 'swversion': None, 'type': 'Window covering device', 'uniqueid': '84:71:27:ff:fe:0d:fa:be-01'}, 'e': 'changed', 'id': '35', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:0d:fa:be-01'}
2021-02-07 18:49:07.076 Error: (ConBee2) Unknow MAJ{'attr': {'id': '35', 'lastannounced': None, 'lastseen': '2021-02-07T17:49Z', 'manufacturername': '_TZ3000_vd43bbfq', 'modelid': 'TS130F', 'name': 'Rolluik Hobby Water', 'swversion': None, 'type': 'Window covering device', 'uniqueid': '84:71:27:ff:fe:0d:fa:be-01'}, 'e': 'changed', 'id': '35', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:0d:fa:be-01'}
2021-02-07 18:49:10.303 (ConBee2) onMessage called
2021-02-07 18:49:10.304 (ConBee2) ### WebSocket Data : {'attr': {'id': '34', 'lastannounced': None, 'lastseen': '2021-02-07T17:49Z', 'manufacturername': '_TZ3000_vd43bbfq', 'modelid': 'TS130F', 'name': 'Rolluik Keuken', 'swversion': None, 'type': 'Window covering device', 'uniqueid': '84:71:27:ff:fe:05:66:9c-01'}, 'e': 'changed', 'id': '34', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:05:66:9c-01'}
2021-02-07 18:49:10.893 (YouLess) P1 Smart Meter (Elektriciteit)
2021-02-07 18:49:10.304 Error: (ConBee2) Unknow MAJ{'attr': {'id': '34', 'lastannounced': None, 'lastseen': '2021-02-07T17:49Z', 'manufacturername': '_TZ3000_vd43bbfq', 'modelid': 'TS130F', 'name': 'Rolluik Keuken', 'swversion': None, 'type': 'Window covering device', 'uniqueid': '84:71:27:ff:fe:05:66:9c-01'}, 'e': 'changed', 'id': '34', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:05:66:9c-01'}
2021-02-07 18:49:11.371 (Zonnepanelen) Updated 1 values out of 16
2021-02-07 18:49:13.825 (ConBee2) onHeartbeat called
I know I pasted a larger part of the log than maybe necessary but I hope you can filter the important parts.

Again... thanks! Your support is one of the key features of Domoticz!

Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by waaren »

Sjonnie2017 wrote: Sunday 07 February 2021 18:57 I know I pasted a larger part of the log than maybe necessary but I hope you can filter the important parts.
This log only shows some messages from the ConBee2 module.
According to these log messages, the script is not triggered.

So either Conbee is not updating the device at all or the eventSystem and dzVents are not both enabled in the settings.
settings.jpg
settings.jpg (24.36 KiB) Viewed 3373 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by Sjonnie2017 »

Hi waaren,

Sorry for my late reply. My settings in Domoticz look exactly like the ones in your screenshot. Rebooted the device (pain in the b4tt) and checked all other settings I could think of and now I get a response in the log. Nothing happens with the shutter though. I captured the part of the log I think is relevant. After the blah blah blah there are no indicators relating to the script or the devices. Somehow I think you can make heads or tails of it but i can't ;)

Code: Select all

2021-02-08 16:53:48.835 (ConBee2) onMessage called
2021-02-08 16:53:48.836 (ConBee2) ### WebSocket Data : {'e': 'changed', 'id': '35', 'r': 'sensors', 'state': {'buttonevent': 1003, 'lastupdated': '2021-02-08T15:53:48.824'}, 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:b3:ad:b4-01-1000'}
2021-02-08 16:53:48.837 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 20, 'sValue': '20'}
2021-02-08 16:53:49.452 (ConBee2) onHeartbeat called
2021-02-08 16:53:49.453 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 0, 'sValue': 'Off'}
2021-02-08 16:53:49.565 (ConBee2) onMessage called
2021-02-08 16:53:49.566 (ConBee2) ### WebSocket Data : {'attr': {'id': '15', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'Schakelaar Voorraadkast', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:2f:58:39-01'}, 'e': 'changed', 'id': '15', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:2f:58:39-01'}
2021-02-08 16:53:49.596 Status: dzVents: > _data:
2021-02-08 16:53:49.596 Status: dzVents: > switchTypeValue: 0
2021-02-08 16:53:49.596 Status: dzVents: > description:
2021-02-08 16:53:49.596 Status: dzVents: > changed: true
2021-02-08 16:53:49.596 Status: dzVents: > baseType: device
2021-02-08 16:53:49.596 Status: dzVents: > data:
2021-02-08 16:53:49.596 Status: dzVents: > hardwareName: ConBee2
2021-02-08 16:53:49.596 Status: dzVents: > unit: 12
2021-02-08 16:53:49.596 Status: dzVents: > hardwareType: deCONZ plugin
2021-02-08 16:53:49.596 Status: dzVents: > usedByCamera: false
2021-02-08 16:53:49.596 Status: dzVents: > hardwareTypeValue: 94
2021-02-08 16:53:49.596 Status: dzVents: > hardwareID: 11
2021-02-08 16:53:49.596 Status: dzVents: > protected: false
2021-02-08 16:53:49.596 Status: dzVents: > icon: lightbulb
2021-02-08 16:53:49.596 Status: dzVents: > levelVal: 0
2021-02-08 16:53:49.596 Status: dzVents: > _state: Off
2021-02-08 16:53:49.596 Status: dzVents: > maxDimLevel: 100
2021-02-08 16:53:49.596 Status: dzVents: > _nValue: 0
2021-02-08 16:53:49.596 Status: dzVents: > name: ConBee2 - Schakelaar Woonkamer 2
2021-02-08 16:53:49.596 Status: dzVents: > subType: Selector Switch
2021-02-08 16:53:49.596 Status: dzVents: > lastLevel: 0
2021-02-08 16:53:49.596 Status: dzVents: > id: 291
2021-02-08 16:53:49.596 Status: dzVents: > rawData:
2021-02-08 16:53:49.596 Status: dzVents: > 1: Off
2021-02-08 16:53:49.596 Status: dzVents: > signalLevel: 12
2021-02-08 16:53:49.596 Status: dzVents: > batteryLevel: 87
2021-02-08 16:53:49.596 Status: dzVents: > lastUpdate: 2021-02-08 16:53:49
2021-02-08 16:53:49.597 Status: dzVents: > deviceType: Light/Switch
2021-02-08 16:53:49.597 Status: dzVents: > timedOut: false
2021-02-08 16:53:49.597 Status: dzVents: > deviceID: cc:cc:cc:ff:fe:b3:ad:b4-01-1000
2021-02-08 16:53:49.597 Status: dzVents: > protected: false
2021-02-08 16:53:49.597 Status: dzVents: > switchType: On/Off
2021-02-08 16:53:49.597 Status: dzVents: > setHotWater()
2021-02-08 16:53:49.597 Status: dzVents: > rawData:
2021-02-08 16:53:49.597 Status: dzVents: > 1: Off
2021-02-08 16:53:49.597 Status: dzVents: > active: false
2021-02-08 16:53:49.597 Status: dzVents: > sValue: Off
2021-02-08 16:53:49.597 Status: dzVents: > updateWind()
2021-02-08 16:53:49.597 Status: dzVents: > updateRadiation()
2021-02-08 16:53:49.597 Status: dzVents: > updateSoilMoisture()
2021-02-08 16:53:49.597 Status: dzVents: > updateBarometer()
2021-02-08 16:53:49.597 Status: dzVents: > updateRain()
2021-02-08 16:53:49.597 Status: dzVents: > isScene: false
2021-02-08 16:53:49.597 Status: dzVents: > playFavorites()
2021-02-08 16:53:49.597 Status: dzVents: > setMode()
2021-02-08 16:53:49.597 Status: dzVents: > deviceId: cc:cc:cc:ff:fe:b3:ad:b4-01-1000
2021-02-08 16:53:49.597 Status: dzVents: > setIcon()
2021-02-08 16:53:49.597 Status: dzVents: > armAway()
2021-02-08 16:53:49.597 Status: dzVents: > setLevel()
2021-02-08 16:53:49.597 Status: dzVents: > _adapters:
2021-02-08 16:53:49.597 Status: dzVents: > 1: Switch device adapter
2021-02-08 16:53:49.597 Status: dzVents: > dimTo()
2021-02-08 16:53:49.597 Status: dzVents: > close()
2021-02-08 16:53:49.597 Status: dzVents: > incrementCounter()
2021-02-08 16:53:49.597 Status: dzVents: > reset()
2021-02-08 16:53:49.597 Status: dzVents: > toggleSwitch()
2021-02-08 16:53:49.597 Status: dzVents: > quietOff()
2021-02-08 16:53:49.597 Status: dzVents: > kodiPause()
2021-02-08 16:53:49.597 Status: dzVents: > quietOn()
2021-02-08 16:53:49.597 Status: dzVents: > volumeUp()
2021-02-08 16:53:49.597 Status: dzVents: > updatePercentage()
2021-02-08 16:53:49.597 Status: dzVents: > pause()
2021-02-08 16:53:49.597 Status: dzVents: > icon: lightbulb
2021-02-08 16:53:49.597 Status: dzVents: > _nValue: 0
2021-02-08 16:53:49.597 Status: dzVents: > setDescription()
2021-02-08 16:53:49.597 Status: dzVents: > updateElectricity()
2021-02-08 16:53:49.597 Status: dzVents: > switchType: On/Off
2021-02-08 16:53:49.597 Status: dzVents: > description:
2021-02-08 16:53:49.597 Status: dzVents: > changed: true
2021-02-08 16:53:49.598 Status: dzVents: > updateCounter()
2021-02-08 16:53:49.598 Status: dzVents: > kodiPlayPlaylist()
2021-02-08 16:53:49.598 Status: dzVents: > play()
2021-02-08 16:53:49.598 Status: dzVents: > updateVisibility()
2021-02-08 16:53:49.598 Status: dzVents: > setValues()
2021-02-08 16:53:49.598 Status: dzVents: > isVariable: false
2021-02-08 16:53:49.598 Status: dzVents: > hardwareID: 11
2021-02-08 16:53:49.598 Status: dzVents: > setNightMode()
2021-02-08 16:53:49.598 Status: dzVents: > kodiPlay()
2021-02-08 16:53:49.598 Status: dzVents: > levelVal: 0
2021-02-08 16:53:49.598 Status: dzVents: > updateCustomSensor()
2021-02-08 16:53:49.598 Status: dzVents: > setState()
2021-02-08 16:53:49.598 Status: dzVents: > updateLux()
2021-02-08 16:53:49.598 Status: dzVents: > isTimer: false
2021-02-08 16:53:49.598 Status: dzVents: > updateWaterflow()
2021-02-08 16:53:49.598 Status: dzVents: > usedByCamera: false
2021-02-08 16:53:49.598 Status: dzVents: > kodiSwitchOff()
2021-02-08 16:53:49.598 Status: dzVents: > setHue()
2021-02-08 16:53:49.598 Status: dzVents: > updateDistance()
2021-02-08 16:53:49.598 Status: dzVents: > updateMode()
2021-02-08 16:53:49.598 Status: dzVents: > hardwareTypeValue: 94
2021-02-08 16:53:49.598 Status: dzVents: > protected: false
2021-02-08 16:53:49.598 Status: dzVents: > id: 291
2021-02-08 16:53:49.598 Status: dzVents: > updateUV()
2021-02-08 16:53:49.598 Status: dzVents: > switchOff()
2021-02-08 16:53:49.598 Status: dzVents: > nValue: 0
2021-02-08 16:53:49.598 Status: dzVents: > isGroup: false
2021-02-08 16:53:49.598 Status: dzVents: > setDiscoMode()
2021-02-08 16:53:49.598 Status: dzVents: > stop()
2021-02-08 16:53:49.598 Status: dzVents: Debug: roomSwitcher: Off
2021-02-08 16:53:49.598 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-08 16:53:49.566 Error: (ConBee2) Unknow MAJ{'attr': {'id': '15', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'Schakelaar Voorraadkast', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:2f:58:39-01'}, 'e': 'changed', 'id': '15', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:2f:58:39-01'}
2021-02-08 16:53:53.762 (Zonnepanelen) Updated 3 values out of 16
2021-02-08 16:53:54.715 (ConBee2) onMessage called
2021-02-08 16:53:54.716 (ConBee2) ### WebSocket Data : {'attr': {'id': '1', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'Simon Lévelt', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:51:89:1c-01'}, 'e': 'changed', 'id': '1', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:51:89:1c-01'}
2021-02-08 16:53:54.915 (YouLess) P1 Smart Meter (Elektriciteit)
2021-02-08 16:53:54.716 Error: (ConBee2) Unknow MAJ{'attr': {'id': '1', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'Simon Lévelt', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:51:89:1c-01'}, 'e': 'changed', 'id': '1', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:51:89:1c-01'}
2021-02-08 16:53:55.120 (ConBee2) onMessage called
2021-02-08 16:53:55.123 (ConBee2) ### WebSocket Data : {'attr': {'id': '24', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'ZB Wandbord', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:21:96:ae-01'}, 'e': 'changed', 'id': '24', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:21:96:ae-01'}
2021-02-08 16:53:55.123 Error: (ConBee2) Unknow MAJ{'attr': {'id': '24', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'ZB Wandbord', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:21:96:ae-01'}, 'e': 'changed', 'id': '24', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:21:96:ae-01'}
2021-02-08 16:53:58.734 (Zonnepanelen) Updated 3 values out of 16
2021-02-08 16:53:58.785 (ConBee2) onMessage called
2021-02-08 16:53:58.786 (ConBee2) ### WebSocket Data : {'attr': {'id': '33', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': '_TZ3000_vd43bbfq', 'modelid': 'TS130F', 'name': 'Rolluik Dressoir', 'swversion': None, 'type': 'Window covering device', 'uniqueid': '84:71:27:ff:fe:0d:f8:09-01'}, 'e': 'changed', 'id': '33', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:0d:f8:09-01'}
2021-02-08 16:53:58.786 (ConBee2) onMessage called
2021-02-08 16:53:58.786 (ConBee2) ### WebSocket Data : {'attr': {'id': '2', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': 'ShenZhen_Homa', 'modelid': 'HOMA1031', 'name': 'Plafond Haard', 'swversion': '1.0.2', 'type': 'Dimmable light', 'uniqueid': '00:12:4b:00:1a:b0:dc:dd-0b'}, 'e': 'changed', 'id': '2', 'r': 'lights', 't': 'event', 'uniqueid': '00:12:4b:00:1a:b0:dc:dd-0b'}
2021-02-08 16:53:58.786 Error: (ConBee2) Unknow MAJ{'attr': {'id': '33', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': '_TZ3000_vd43bbfq', 'modelid': 'TS130F', 'name': 'Rolluik Dressoir', 'swversion': None, 'type': 'Window covering device', 'uniqueid': '84:71:27:ff:fe:0d:f8:09-01'}, 'e': 'changed', 'id': '33', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:0d:f8:09-01'}
2021-02-08 16:53:58.787 Error: (ConBee2) Unknow MAJ{'attr': {'id': '2', 'lastannounced': None, 'lastseen': '2021-02-08T15:53Z', 'manufacturername': 'ShenZhen_Homa', 'modelid': 'HOMA1031', 'name': 'Plafond Haard', 'swversion': '1.0.2', 'type': 'Dimmable light', 'uniqueid': '00:12:4b:00:1a:b0:dc:dd-0b'}, 'e': 'changed', 'id': '2', 'r': 'lights', 't': 'event', 'uniqueid': '00:12:4b:00:1a:b0:dc:dd-0b'}
2021-02-08 16:53:59.438 (ConBee2) onHeartbeat called
2021-02-08 16:54:03.740 (Zonnepanelen) Updated 3 values out of 16
2021-02-08 16:54:04.932 (YouLess) P1 Smart Meter (Elektriciteit) blah blah blah
Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by waaren »

Sjonnie2017 wrote: Monday 08 February 2021 16:59 Nothing happens with the shutter though...

Code: Select all

2021-02-08 16:53:49.596 Status: dzVents: > _state: Off
2021-02-08 16:53:49.597 Status: dzVents: > active: false
Based on these loglines my conclusion is that the device gets updated but does not change it's state to 'On'
That is not something dzVents can influence but below version of the script will switch device 77 to On if 'ConBee2 - Schakelaar Woonkamer 2' triggers the script, regardless the state passed to dzVents.

Please let me know your findings with this version

Code: Select all

--Control Zigbee roller shutter module QS-ZIGBEE-C01 with additional switch (IKEA E1743)
--IDX roller shutter module: 274
--IDX roller shutter module eettafel (for testing purposes): 77
--IDX IKEA switch: 291 ; Name: Conbee2 - Schakelaar Woonkamer 2

return
{

    on =
    {
        devices =
        {
            'ConBee2 - Schakelaar Woonkamer 2',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG,
        marker = 'roomSwitcher',
    },

    execute = function(dz, item)
        dz.devices(77).switchOn().checkFirst()
        dz.log(item.state, dz.LOG_DEBUG)
    end
}

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by Sjonnie2017 »

Well, progress :mrgreen:

If I run the script on a ZigBee module the roller shutter works. It shuts but can't be interrupted and closing (obviously) does not work yet. If I run the script against a KaKu module (SUN-500) the roller shutter works. I can interrupt the action but after about ten seconds the roller shutter re-activates and does so untill fully closed.

I have added the logs running the script against the KaKu module:

Code: Select all

2021-02-08 17:57:02.361 (ConBee2) onMessage called
2021-02-08 17:57:02.363 (ConBee2) ### WebSocket Data : {'e': 'changed', 'id': '35', 'r': 'sensors', 'state': {'buttonevent': 2001, 'lastupdated': '2021-02-08T16:57:02.312'}, 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:b3:ad:b4-01-1000'}
2021-02-08 17:57:02.364 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 0, 'sValue': 'Off'}, IGNORED , no changes !
2021-02-08 17:57:02.415 (ConBee2) onMessage called
2021-02-08 17:57:02.415 (ConBee2) ### WebSocket Data : {'e': 'changed', 'id': '35', 'r': 'sensors', 'state': {'buttonevent': 2003, 'lastupdated': '2021-02-08T16:57:02.366'}, 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:b3:ad:b4-01-1000'}
2021-02-08 17:57:02.415 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 40, 'sValue': '40'}
2021-02-08 17:57:02.576 (HomeWizard) onCommand called for Unit 19: Parameter 'On', Level: 0
2021-02-08 17:57:02.557 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "40"
2021-02-08 17:57:02.557 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-08 17:57:02.558 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-08 17:57:02.558 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:02.558 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:02.558 Status: dzVents: Debug: roomSwitcher: 40
2021-02-08 17:57:02.559 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-08 17:57:02.560 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-08 17:57:02.667 Error: (HomeWizard) Error handling the /sw response!
2021-02-08 17:57:05.722 (ConBee2) onHeartbeat called
2021-02-08 17:57:05.723 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 0, 'sValue': 'Off'}
2021-02-08 17:57:05.938 (HomeWizard) onCommand called for Unit 19: Parameter 'On', Level: 0
2021-02-08 17:57:05.898 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Off"
2021-02-08 17:57:05.898 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-08 17:57:05.899 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-08 17:57:05.900 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:05.900 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:05.900 Status: dzVents: Debug: roomSwitcher: Off
2021-02-08 17:57:05.900 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-08 17:57:05.901 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-08 17:57:06.785 (Zonnepanelen) Updated 1 values out of 16
2021-02-08 17:57:06.017 Error: (HomeWizard) Error handling the /sw response!
2021-02-08 17:57:07.937 (ConBee2) onMessage called
2021-02-08 17:57:07.938 (ConBee2) ### WebSocket Data : {'e': 'changed', 'id': '35', 'r': 'sensors', 'state': {'buttonevent': 2002, 'lastupdated': '2021-02-08T16:57:07.901'}, 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:b3:ad:b4-01-1000'}
2021-02-08 17:57:07.939 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 30, 'sValue': '30'}
2021-02-08 17:57:08.206 (HomeWizard) onCommand called for Unit 19: Parameter 'On', Level: 0
2021-02-08 17:57:08.118 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "30"
2021-02-08 17:57:08.119 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-08 17:57:08.120 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-08 17:57:08.120 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:08.120 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:08.120 Status: dzVents: Debug: roomSwitcher: 30
2021-02-08 17:57:08.121 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-08 17:57:08.122 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-08 17:57:08.288 Error: (HomeWizard) Error handling the /sw response!
2021-02-08 17:57:10.347 (YouLess) P1 Smart Meter (Elektriciteit)
2021-02-08 17:57:10.657 (ConBee2) onMessage called
2021-02-08 17:57:10.658 (ConBee2) ### WebSocket Data : {'e': 'changed', 'id': '35', 'r': 'sensors', 'state': {'buttonevent': 2002, 'lastupdated': '2021-02-08T16:57:10.627'}, 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:b3:ad:b4-01-1000'}
2021-02-08 17:57:10.659 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 30, 'sValue': '30'}
2021-02-08 17:57:10.825 (HomeWizard) onCommand called for Unit 19: Parameter 'On', Level: 0
2021-02-08 17:57:10.795 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "30"
2021-02-08 17:57:10.795 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-08 17:57:10.797 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-08 17:57:10.797 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:10.797 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:10.797 Status: dzVents: Debug: roomSwitcher: 30
2021-02-08 17:57:10.797 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-08 17:57:10.799 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-08 17:57:10.914 Error: (HomeWizard) Error handling the /sw response!
2021-02-08 17:57:11.215 (ConBee2) onMessage called
2021-02-08 17:57:11.216 (ConBee2) ### WebSocket Data : {'attr': {'id': '20', 'lastannounced': '2020-12-14T15:51:33Z', 'lastseen': '2021-02-08T16:57Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'Slaapkamer Bed', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:42:6d:b7-01'}, 'e': 'changed', 'id': '20', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:42:6d:b7-01'}
2021-02-08 17:57:11.517 (ConBee2) onMessage called
2021-02-08 17:57:11.517 (ConBee2) ### WebSocket Data : {'attr': {'id': '19', 'lastannounced': '2021-01-31T17:00:11Z', 'lastseen': '2021-02-08T16:57Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI bulb E27 WW clear 250lm', 'name': 'Dressoir A school Links', 'swversion': '2.1.022', 'type': 'Dimmable light', 'uniqueid': '14:b4:57:ff:fe:46:68:69-01'}, 'e': 'changed', 'id': '19', 'r': 'lights', 't': 'event', 'uniqueid': '14:b4:57:ff:fe:46:68:69-01'}
2021-02-08 17:57:11.880 (Zonnepanelen) Updated 2 values out of 16
2021-02-08 17:57:11.216 Error: (ConBee2) Unknow MAJ{'attr': {'id': '20', 'lastannounced': '2020-12-14T15:51:33Z', 'lastseen': '2021-02-08T16:57Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'Slaapkamer Bed', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:42:6d:b7-01'}, 'e': 'changed', 'id': '20', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:42:6d:b7-01'}
2021-02-08 17:57:11.518 Error: (ConBee2) Unknow MAJ{'attr': {'id': '19', 'lastannounced': '2021-01-31T17:00:11Z', 'lastseen': '2021-02-08T16:57Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI bulb E27 WW clear 250lm', 'name': 'Dressoir A school Links', 'swversion': '2.1.022', 'type': 'Dimmable light', 'uniqueid': '14:b4:57:ff:fe:46:68:69-01'}, 'e': 'changed', 'id': '19', 'r': 'lights', 't': 'event', 'uniqueid': '14:b4:57:ff:fe:46:68:69-01'}
2021-02-08 17:57:15.837 (ConBee2) onHeartbeat called
2021-02-08 17:57:15.838 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 0, 'sValue': 'Off'}
2021-02-08 17:57:15.979 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Off"
2021-02-08 17:57:15.979 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-08 17:57:15.981 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-08 17:57:15.981 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:15.981 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-08 17:57:15.982 Status: dzVents: Debug: roomSwitcher: Off
2021-02-08 17:57:15.982 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-08 17:57:15.983 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-08 17:57:16.005 (HomeWizard) onCommand called for Unit 19: Parameter 'On', Level: 0
2021-02-08 17:57:16.898 (Zonnepanelen) Updated 1 values out of 16
2021-02-08 17:57:16.086 Error: (HomeWizard) Error handling the /sw response!
Gosh... this is complicated ;)

Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by waaren »

Sjonnie2017 wrote: Monday 08 February 2021 18:06 I have added the logs running the script against the KaKu module:
Gosh... this is complicated ;)
Your 'schakelaar sends a state '30' 'to domoticz when activated and 'Off' when Off. van you check with this one?

Code: Select all


--Control Zigbee roller shutter module QS-ZIGBEE-C01 with additional switch (IKEA E1743)
--IDX roller shutter module: 274
--IDX roller shutter module eettafel (for testing purposes): 77
--IDX IKEA switch: 291 ; Name: Conbee2 - Schakelaar Woonkamer 2

return
{

    on =
    {
        devices =
        {
            'ConBee2 - Schakelaar Woonkamer 2',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG,
        marker = 'roomSwitcher',
    },

    execute = function(dz, item)
		if item.state ~= 'Off' then
			dz.devices(77).switchOn().checkFirst()
        else
			dz.devices(77).switchOff().checkFirst()
        end
		dz.log(item.state, dz.LOG_DEBUG)
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by Sjonnie2017 »

The new script works pretty much the same as the previous one. I ran it against the KaKu module and if I wait just long enough I can interrupt the closing. If I press the Off button it just continuous closing but that may be expected perhaps.

And the log:

Code: Select all

2021-02-09 10:49:04.872 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/DzV - Schakelaar keuken.lua
2021-02-09 10:49:10.044 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Sound 2"
2021-02-09 10:49:10.044 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 10:49:10.046 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 10:49:10.046 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 10:49:10.046 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 10:49:10.046 Status: dzVents: Debug: roomSwitcher: Sound 2
2021-02-09 10:49:10.046 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 10:49:10.049 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-09 10:49:10.202 Error: (HomeWizard) Error handling the /sw response!
2021-02-09 10:49:13.473 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Off"
2021-02-09 10:49:13.473 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 10:49:13.474 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 10:49:13.474 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: Off
2021-02-09 10:49:13.475 Status: dzVents: Debug: roomSwitcher: Off
2021-02-09 10:49:13.475 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 10:49:14.553 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Sound 2"
2021-02-09 10:49:14.553 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 10:49:14.555 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 10:49:14.555 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 10:49:14.555 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 10:49:14.555 Status: dzVents: Debug: roomSwitcher: Sound 2
2021-02-09 10:49:14.555 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 10:49:14.557 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-09 10:49:14.697 Error: (HomeWizard) Error handling the /sw response!
2021-02-09 10:49:21.079 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Sound 2"
2021-02-09 10:49:21.079 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 10:49:21.080 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 10:49:21.080 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 10:49:21.081 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 10:49:21.081 Status: dzVents: Debug: roomSwitcher: Sound 2
2021-02-09 10:49:21.081 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 10:49:21.082 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-09 10:49:21.219 Error: (HomeWizard) Error handling the /sw response!
2021-02-09 10:49:23.554 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Off"
2021-02-09 10:49:23.554 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 10:49:23.555 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 10:49:23.556 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: Off
2021-02-09 10:49:23.556 Status: dzVents: Debug: roomSwitcher: Off
2021-02-09 10:49:23.556 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 10:49:30.740 Error: (ConBee2) Unknow MAJ{'attr': {'id': '30', 'lastannounced': None, 'lastseen': '2021-02-09T09:49Z', 'manufacturername': '_TZ3000_vd43bbfq', 'modelid': 'TS130F', 'name': 'Rolluik Tuin Deur', 'swversion': None, 'type': 'Window covering device', 'uniqueid': '84:71:27:ff:fe:0d:f9:32-01'}, 'e': 'changed', 'id': '30', 'r': 'lights', 't': 'event', 'uniqueid': '84:71:27:ff:fe:0d:f9:32-01'}
2021-02-09 10:49:36.583 Error: (ConBee2) Unknow MAJ{'attr': {'id': '18', 'lastannounced': None, 'lastseen': '2021-02-09T09:49Z', 'manufacturername': 'dresden elektronik', 'modelid': 'ConBee II', 'name': 'Unknown 18', 'swversion': '0x264a0700', 'type': 'Unknown', 'uniqueid': '00:21:2e:ff:ff:04:f6:0c-01'}, 'e': 'changed', 'id': '1', 'r': 'lights', 't': 'event', 'uniqueid': '00:21:2e:ff:ff:04:f6:0c-01'}
2021-02-09 10:49:38.288 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "40"
2021-02-09 10:49:38.288 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 10:49:38.290 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 10:49:38.290 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 10:49:38.290 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 10:49:38.290 Status: dzVents: Debug: roomSwitcher: 40
2021-02-09 10:49:38.290 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 10:49:38.291 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-09 10:49:38.438 Error: (HomeWizard) Error handling the /sw response!
2021-02-09 10:49:43.515 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Off"
2021-02-09 10:49:43.515 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 10:49:43.516 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 10:49:43.516 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: Off
2021-02-09 10:49:43.516 Status: dzVents: Debug: roomSwitcher: Off
2021-02-09 10:49:43.517 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by waaren »

Sjonnie2017 wrote: Tuesday 09 February 2021 10:55 The new script works pretty much the same as the previous one. I ran it against the KaKu module and if I wait just long enough I can interrupt the closing. If I press the Off button it just continuous closing but that may be expected perhaps.
In the this log I can see dzVents does send the Off command when expected. No idea why the KaKu module does not react to that. How do you interrupt it from the GUI?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by Sjonnie2017 »

That depends. If the shutter is going down, I can press the "close" icon in Domoticz again and it stops. Or I press the Stop button. If the shutter is going down and I press the "open" button it stops and starts to open again.

The logs:

Code: Select all

2021-02-09 11:34:43.634 (HomeWizard) onCommand called for Unit 19: Parameter 'On', Level: 0
2021-02-09 11:34:43.603 Status: User: Admin initiated a switch command (77/Luik Eettafel/On)
2021-02-09 11:34:43.746 Error: (HomeWizard) Error handling the /sw response!
2021-02-09 11:34:44.194 (Zonnepanelen) Updated 8 values out of 16
2021-02-09 11:34:45.998 (ConBee2) onHeartbeat called
2021-02-09 11:34:48.103 (HomeWizard) onCommand called for Unit 19: Parameter 'On', Level: 0
2021-02-09 11:34:48.080 Status: User: Admin initiated a switch command (77/Luik Eettafel/On)
2021-02-09 11:34:48.212 Error: (HomeWizard) Error handling the /sw response!
2021-02-09 11:34:49.246 (Zonnepanelen) Updated 8 values out of 16
2021-02-09 11:34:51.522 (YouLess) P1 Smart Meter (Elektriciteit)
2021-02-09 11:34:54.236 (Zonnepanelen) Updated 9 values out of 16
2021-02-09 11:34:55.988 (ConBee2) onHeartbeat called
2021-02-09 11:34:55.136 Error: (HomeWizard) Error handling the /sw response!
2021-02-09 11:34:59.192 (Zonnepanelen) Updated 8 values out of 16
2021-02-09 11:34:59.192 (HomeWizard) onCommand called for Unit 19: Parameter 'Stop', Level: 0
2021-02-09 11:34:59.088 Status: User: Admin initiated a switch command (77/Luik Eettafel/Stop)
2021-02-09 11:35:01.535 (YouLess) P1 Smart Meter (Elektriciteit)
2021-02-09 11:35:03.720 (HomeWizard) onCommand called for Unit 19: Parameter 'Stop', Level: 0
2021-02-09 11:35:03.678 Status: User: Admin initiated a switch command (77/Luik Eettafel/Stop)
2021-02-09 11:35:04.212 (Zonnepanelen) Updated 9 values out of 16
2021-02-09 11:35:04.965 (ConBee2) onMessage called
2021-02-09 11:35:04.965 (ConBee2) ### WebSocket Data : {'attr': {'id': '4', 'lastannounced': None, 'lastseen': '2021-02-09T10:35Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'Schakelaar Secretaire', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:1a:f1:d8-01'}, 'e': 'changed', 'id': '4', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:1a:f1:d8-01'}
2021-02-09 11:35:04.966 Error: (ConBee2) Unknow MAJ{'attr': {'id': '4', 'lastannounced': None, 'lastseen': '2021-02-09T10:35Z', 'manufacturername': 'IKEA of Sweden', 'modelid': 'TRADFRI control outlet', 'name': 'Schakelaar Secretaire', 'swversion': '2.0.022', 'type': 'On/Off plug-in unit', 'uniqueid': '08:6b:d7:ff:fe:1a:f1:d8-01'}, 'e': 'changed', 'id': '4', 'r': 'lights', 't': 'event', 'uniqueid': '08:6b:d7:ff:fe:1a:f1:d8-01'}
2021-02-09 11:35:05.968 (ConBee2) onHeartbeat called
2021-02-09 11:35:08.322 (HomeWizard) onCommand called for Unit 19: Parameter 'Off', Level: 0
2021-02-09 11:35:08.283 Status: User: Admin initiated a switch command (77/Luik Eettafel/Off)
2021-02-09 11:35:09.204 (Zonnepanelen) Updated 8 values out of 16
2021-02-09 11:35:10.106 (HomeWizard) onCommand called for Unit 19: Parameter 'Off', Level: 0
2021-02-09 11:35:10.089 Status: User: Admin initiated a switch command (77/Luik Eettafel/Off)
2021-02-09 11:35:11.547 (YouLess) P1 Smart Meter (Elektriciteit)
2021-02-09 11:35:11.563 (YouLess) P1 Smart Meter (Gas)
2021-02-09 11:35:14.557 (Zonnepanelen) Updated 8 values out of 16
2021-02-09 11:35:14.658 (HomeWizard) onCommand called for Unit 19: Parameter 'Off', Level: 0
2021-02-09 11:35:14.616 Status: User: Admin initiated a switch command (77/Luik Eettafel/Off)
2021-02-09 11:35:16.341 (ConBee2) onHeartbeat called
2021-02-09 11:35:17.493 (ConBee2) onMessage called
Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by waaren »

Sjonnie2017 wrote: Tuesday 09 February 2021 11:37 That depends. If the shutter is going down, I can press the "close" icon in Domoticz again and it stops. Or I press the Stop button. If the shutter is going down and I press the "open" button it stops and starts to open again.
From your previous logs I see that the "ConBee2 - Schakelaar Woonkamer 2" can have state "30", "40", "Sound 2" and "Off"
How would you want these states to be mapped to the On, Stop, Open, Close and Off commands to be send to the shutter?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by Sjonnie2017 »

Hi waaren,

I am not exactly sure. I will make a wild guess and experiment with the values if the behaviour is not what I would like/need.

I think the button presses corresponding to the values are:
First press On seems to correspond to: 30 (should close the shutter)
Second press On seems to correspond to: 40 (should close the shutter)
First press Off seems to correspond to: Sound 2 (???) (should open shutter)
Second press Offseems to correspond to: Off (should open shutter)

I tested the button again and pressed On twice within a period of about 2 seconds and consecutively pressed the off button twice in about the same number of seconds. This is what the log shows:

Code: Select all

2021-02-09 13:18:44.084 (ConBee2) onMessage called
2021-02-09 13:18:44.085 (ConBee2) ### WebSocket Data : {'e': 'changed', 'id': '35', 'r': 'sensors', 'state': {'buttonevent': 2002, 'lastupdated': '2021-02-09T12:18:44.071'}, 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:b3:ad:b4-01-1000'}
2021-02-09 13:18:44.087 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 30, 'sValue': '30'}
2021-02-09 13:18:44.359 (HomeWizard) onCommand called for Unit 19: Parameter 'On', Level: 0
2021-02-09 13:18:44.441 (ConBee2) onHeartbeat called
2021-02-09 13:18:44.442 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 0, 'sValue': 'Off'}
2021-02-09 13:18:44.276 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "30"
2021-02-09 13:18:44.276 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 13:18:44.277 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 13:18:44.278 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 13:18:44.278 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 13:18:44.278 Status: dzVents: Debug: roomSwitcher: 30
2021-02-09 13:18:44.278 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 13:18:44.279 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-09 13:18:44.581 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Off"
2021-02-09 13:18:44.581 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 13:18:44.583 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 13:18:44.583 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: Off
2021-02-09 13:18:44.583 Status: dzVents: Debug: roomSwitcher: Off
2021-02-09 13:18:44.583 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 13:18:44.441 Error: (HomeWizard) Error handling the /sw response!
2021-02-09 13:18:45.231 (HomeWizard) Update 0:'9.8;49;0' (Schuur)
2021-02-09 13:18:47.288 (Zonnepanelen) Updated 9 values out of 16
2021-02-09 13:18:48.548 (ConBee2) onMessage called
2021-02-09 13:18:48.549 (ConBee2) ### WebSocket Data : {'e': 'changed', 'id': '35', 'r': 'sensors', 'state': {'buttonevent': 2002, 'lastupdated': '2021-02-09T12:18:48.499'}, 't': 'event', 'uniqueid': 'cc:cc:cc:ff:fe:b3:ad:b4-01-1000'}
2021-02-09 13:18:48.549 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 30, 'sValue': '30'}
2021-02-09 13:18:48.716 (HomeWizard) onCommand called for Unit 19: Parameter 'On', Level: 0
2021-02-09 13:18:48.689 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "30"
2021-02-09 13:18:48.689 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 13:18:48.691 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 13:18:48.691 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 13:18:48.691 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: On
2021-02-09 13:18:48.691 Status: dzVents: Debug: roomSwitcher: 30
2021-02-09 13:18:48.692 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 13:18:48.693 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-02-09 13:18:48.800 Error: (HomeWizard) Error handling the /sw response!
2021-02-09 13:18:50.750 (YouLess) P1 Smart Meter (Elektriciteit)
2021-02-09 13:18:52.315 (Zonnepanelen) Updated 10 values out of 16
2021-02-09 13:18:54.369 (ConBee2) onHeartbeat called
2021-02-09 13:18:54.370 (ConBee2) ### Update device (ConBee2 - Schakelaar Woonkamer 2) : {'nValue': 0, 'sValue': 'Off'}
2021-02-09 13:18:54.564 Status: dzVents: Info: Handling events for: "ConBee2 - Schakelaar Woonkamer 2", value: "Off"
2021-02-09 13:18:54.564 Status: dzVents: Info: roomSwitcher: ------ Start internal script: DzV - Schakelaar keuken: Device: "ConBee2 - Schakelaar Woonkamer 2 (ConBee2)", Index: 291
2021-02-09 13:18:54.566 Status: dzVents: Debug: roomSwitcher: Processing device-adapter for Luik Eettafel: Switch device adapter
2021-02-09 13:18:54.566 Status: dzVents: Debug: roomSwitcher: Constructed timed-command: Off
2021-02-09 13:18:54.566 Status: dzVents: Debug: roomSwitcher: Off
2021-02-09 13:18:54.566 Status: dzVents: Info: roomSwitcher: ------ Finished DzV - Schakelaar keuken
2021-02-09 13:18:57.346 (Zonnepanelen) Updated 8 values out of 16
2021-02-09 13:19:00.763 (YouLess) P1 Smart Meter (Elektriciteit)
2021-02-09 13:19:02.316 (Zonnepanelen) Updated 10 values out of 16
2021-02-09 13:19:04.370 (ConBee2) onHeartbeat called
2021-02-09 13:19:04.771 (ConBee2) onMessage called
2021-02-09 13:19:04.773 (ConBee2) ### WebSocket Data : {'attr': {'id': '2', 'lastannounced': None, 'lastseen': '2021-02-09T12:19Z', 'manufacturername': 'ShenZhen_Homa', 'modelid': 'HOMA1031', 'name': 'Plafond Haard', 'swversion': '1.0.2', 'type': 'Dimmable light', 'uniqueid': '00:12:4b:00:1a:b0:dc:dd-0b'}, 'e': 'changed', 'id': '2', 'r': 'lights', 't': 'event', 'uniqueid': '00:12:4b:00:1a:b0:dc:dd-0b'}
Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by waaren »

Sjonnie2017 wrote: Tuesday 09 February 2021 13:24 I am not exactly sure. I will make a wild guess and experiment with the values if the behaviour is not what I would like/need.
Something to use in your experiments

Code: Select all

--Control Zigbee roller shutter module QS-ZIGBEE-C01 with additional switch (IKEA E1743)
--IDX roller shutter module: 274
--IDX roller shutter module eettafel (for testing purposes): 77
--IDX IKEA switch: 291 ; Name: Conbee2 - Schakelaar Woonkamer 2

return
{

    on =
    {
        devices =
        {
            'ConBee2 - Schakelaar Woonkamer 2',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG,
        marker = 'roomSwitcher',
    },

    execute = function(dz, item)

        if item.state == '30' or item.state == '40' then
            dz.devices(77).open()
        else
            dz.devices(77).close()
        end
        dz.log(item.state, dz.LOG_DEBUG)
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'  [Solved]

Post by Sjonnie2017 »

Hi waaren,

Tx very much. I will need some experimenting because the switch is fooling the shutter. If I send the Off (open) command the shutter opens and after 3 or 4 seconds closes again. Well, I'll get it sorted I guess. And I have some Aqara wall switches ordered which will arrive soon and I can test with them as well.

Again thanks!

Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
Sjonnie2017
Posts: 375
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Ultimate NOOB question: Unexpected symbol '}' near '<eof>'

Post by Sjonnie2017 »

My Aqara wall switches came yesterday and I added them to Domoticz (through Phoscon and the connector by Thorgal). Did some experiments getting the correct values and after a few tries I got the desired result. Below is the final result for the dzVents script which is working flawlessly :)

Code: Select all

--Control Zigbee roller shutter module QS-ZIGBEE-C01 with additional switch (Aqara WXKG07LM)
--IDX roller shutter module: 274
--IDX Aqara Schakelaar: 305; naam: Schakelaar Keuken

return
{

    on =
    {
        devices =
        {
            'Schakelaar Keuken',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG,
        marker = 'roomSwitcher',
    },

    execute = function(dz, item)
        if item.state == '10' or item.state == 'B1' then
            dz.devices(274).open()
        elseif item.state == '20' or item.state == 'B2' then
            dz.devices(274).close()
        elseif item.state == '30' or item.state == 'B3' then
            dz.devices(274).stop()
        end
        dz.log(item.state, dz.LOG_DEBUG)
    end
}
I should buy waaren a coffee for his relentless efforts of supporting me :mrgreen:

Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest