PLEG - How to create a Master dimmer to sync multiple lamps

Yeah, I added to the store because a lot of people complained about that. It’s easier to install, update, and so on. But it’s really easy just to copy the files you need and manually start with it.

I have deleted the device the plugin installation created and then I tried to change it to an RGB dimmer.

I have created a new device now:

What was confusing me was I thought you had to specify the “Device Type” but when creating a device you can leave that field blank.

After a LUUP reload the system populates those fields automatically, so now I have the following:

device_type = urn:schemas-upnp-org:device:DimmableRGBLight:1
device_json = D_DimmableRGBLight1.json

Also looking in the Variables tab now that looks better, I no longer have duplicates with different Service ID.

image

So I just need to work out the URLs for controlling devices that are actually in Vera using Luup Requests.

I know your plugin is designed more for controlling devices outside of Vera like Shelly and Tasmota WIFI devices.

This website can be used for constructing HTTP Luup Requests to control devices in Vera:

https://www.smarthome.com.au/smarthome-blog/vera-http-commands/

Example On command:

http://192.168.0.12:3480/data_request?id=lu_action&output_format=json&DeviceNum=600&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1

Example Off Command

http://192.168.0.12:3480/data_request?id=lu_action&output_format=json&DeviceNum=600&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0

I added these in the Variables of the virtual RGB dimmer

image

However something is still not working.

This button doesn’t work and is stuck in the On position:

image

And on this page it shows as being off, if I press the on button in here, I get a spinning circle and the button remains set to off and the real lamp does not turn on.

Looking in the Params tab of the virtual RGB dimmer device, the Category was set to 666 I changed this to 2.

However I don’t see a sub category field present at all, which is odd its missing.

Subcategory should be created and set automatically.

Use 127.0.0.1 for local calls. I created it for external devices but I’m using it for local control as well. Ie I have a virtual door lock using a switch and a door sensor, calling the Vera url to open the switch. Or a virtual sensor to toggle two scene for on/off. And so on.

Set debugmode to 1 and look at the logs.

Buttons not working normally means no implementation file or a bad implementation file.

I’ll keep trying and look at the logs.

I’ve just deleted the RGB Dimmer device and created a new one again and reloaded the Luup engine.

The category number is given 666 sign of the beast LOL and still no sub category can be seen present.

image

How to turn on debug logging for the plugin ?

Thanks

When pressing the on / off button on the RGB Dimmer virtual device I have just seen this in the log file:

02/06/21 18:40:01.014	LuaInterface::CallFunction_Request device 103 LuaViewRequestHandler/LuaView took 46 seconds <0x70aa6520>
01	02/06/21 18:40:01.051	LuaInterface::CallFunction_Request device 103 LuaViewRequestHandler/LuaView took 16 seconds <0x702a6520>
08	02/06/21 18:40:37.850	JobHandler_LuaUPnP::HandleActionRequest device: 117 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x6f8a6520>
08	02/06/21 18:40:37.851	JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=117 <0x6f8a6520>
08	02/06/21 18:40:37.851	JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:SwitchPower1 <0x6f8a6520>
08	02/06/21 18:40:37.852	JobHandler_LuaUPnP::HandleActionRequest argument action=SetTarget <0x6f8a6520>
08	02/06/21 18:40:37.852	JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=0 <0x6f8a6520>
08	02/06/21 18:40:37.852	JobHandler_LuaUPnP::HandleActionRequest argument rand=0.5122077554179805 <0x6f8a6520>
01	02/06/21 18:40:37.853	GetLuaInterface can't find device type: 4/0xd01ba0 str: 0 <0x6f8a6520>
01	02/06/21 18:40:37.854	luup_variable_get interface 0xceff40 args 3 <0x6f8a6520>
01	02/06/21 18:40:37.854	GetLuaInterface can't find device type: 4/0xd01ba0 str: 0 <0x6f8a6520>
01	02/06/21 18:40:37.854	luup_variable_get interface 0xceff40 args 3 <0x6f8a6520>
01	02/06/21 18:40:37.855	GetLuaInterface can't find device type: 4/0xd01ba0 str: 0 <0x6f8a6520>
01	02/06/21 18:40:37.855	luup_variable_get interface 0xceff40 args 3 <0x6f8a6520>
01	02/06/21 18:40:37.856	GetLuaInterface can't find device type: 4/0xd01ba0 str: 0 <0x6f8a6520>
01	02/06/21 18:40:37.857	luup_variable_set interface 0xceff40 args 4 <0x6f8a6520>
01	02/06/21 18:40:37.857	GetLuaInterface can't find device type: 4/0xd01ba0 str: 0 <0x6f8a6520>
01	02/06/21 18:40:37.857	luup_variable_get interface 0xceff40 args 3 <0x6f8a6520>
01	02/06/21 18:40:37.858	GetLuaInterface can't find device type: 4/0xd01ba0 str: 0 <0x6f8a6520>
01	02/06/21 18:40:37.858	luup_variable_get interface 0xceff40 args 3 <0x6f8a6520>
08	02/06/21 18:40:45.306	JobHandler_LuaUPnP::HandleActionRequest device: 117 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x710a6520>
08	02/06/21 18:40:45.306	JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=117 <0x710a6520>
08	02/06/21 18:40:45.307	JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:SwitchPower1 <0x710a6520>
08	02/06/21 18:40:45.307	JobHandler_LuaUPnP::HandleActionRequest argument action=SetTarget <0x710a6520>
08	02/06/21 18:40:45.308	JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=1 <0x710a6520>
08	02/06/21 18:40:45.308	JobHandler_LuaUPnP::HandleActionRequest argument rand=0.3359433726740324 <0x710a6520>
01	02/06/21 18:40:45.309	GetLuaInterface can't find device type: 4/0xd01ba0 str: 1 <0x710a6520>
01	02/06/21 18:40:45.309	luup_variable_get interface 0xceff40 args 3 <0x710a6520>
01	02/06/21 18:40:45.310	GetLuaInterface can't find device type: 4/0xd01ba0 str: 1 <0x710a6520>
01	02/06/21 18:40:45.310	luup_variable_get interface 0xceff40 args 3 <0x710a6520>
01	02/06/21 18:40:45.311	GetLuaInterface can't find device type: 4/0xd01ba0 str: 1 <0x710a6520>
01	02/06/21 18:40:45.311	luup_variable_get interface 0xceff40 args 3 <0x710a6520>
01	02/06/21 18:40:45.311	GetLuaInterface can't find device type: 4/0xd01ba0 str: 1 <0x710a6520>
01	02/06/21 18:40:45.312	luup_variable_set interface 0xceff40 args 4 <0x710a6520>
01	02/06/21 18:40:45.313	GetLuaInterface can't find device type: 4/0xd01ba0 str: 1 <0x710a6520>
01	02/06/21 18:40:45.313	luup_variable_get interface 0xceff40 args 3 <0x710a6520>
01	02/06/21 18:40:45.313	GetLuaInterface can't find device type: 4/0xd01ba0 str: 1 <0x710a6520>
01	02/06/21 18:40:45.314	luup_variable_get interface 0xceff40 args 3 <0x710a6520>

I’ll test on a fresh unit tomorrow. Debugmode variable set to 1 to see more info, but it seems to crash at startup.

1 Like

So, everything is fine for me @cw-kid. Look at your startup logs after you’ve sent a luup.reload, mabye there’s something else going on.