"Direct device" button

57 views
Skip to first unread message

Sascha Volkenandt

unread,
Dec 7, 2015, 7:56:28 AM12/7/15
to plan44_vdcd
Hello everyone,

I am currently developing an external device based on the ESP8266 uC with integrated WiFi. Communicating with vdcd works very good so far to switch relays and report button presses.

One question I have regards the type of button attached to a device. The device is configured as a basic output in the yellow group with one button (where the button has everything set to default), JSON string below. When viewed in the digitalSTROM web interface, I can configure this button only to be a room switch or an area switch (german "Raumtaster", "Bereichstaster"). When I connect a GE-KM200 or -KL200, I can also choose the switch to be a device switch ("Gerätetaster") to be controlled without influencing the rest of the room.

Is there any way to achieve this with the vdcd external device api?

Regards,
Sascha Volkenandt

Lukas Zeller

unread,
Dec 7, 2015, 8:14:04 AM12/7/15
to Sascha Volkenandt, plan44_vdcd
Hi Sascha,
The vdcd does not yet implement local buttons (that is, it's prepared already, but only half way done). The reason is simply that the devices I came across so far never had a button and and output combined, but were either output or button.

Yours seems to be the first of that kind (except the real dS terminal blocks, of course) ;-)

I'll have a look at the code, I guess it should be only little work to get it done, at least basic functionality (toggle between main on and main off scenes and dimming). From the external devices API, you can expect a new boolean option "localbutton" to enable your button for local operation. I'll let you know as soon as I have something testable...

Best Regards,

Lukas


Lukas Zeller

unread,
Dec 7, 2015, 6:07:52 PM12/7/15
to Sascha Volkenandt, plan44_vdcd
Hi again,

I already found the time to complete the local button implementation :-)

It's on the "luz" branch on github (https://github.com/plan44/vdcd/tree/luz), of course not yet tested extensively, but I did a quick test with an external device with a button and an output, and it seems to work fine. Both single buttons and up/down pairs are supported, for on/off and dimming. Just let me know if you find any issues.

To make a button ready to allow local button operation, include "localbutton":true in the button options in your "init" message. This does NOT yet make the button act as a local button, it is still a room button by default. For that, you (or the dSS configurator) need to change buttonInputSettings[0].function from 5 (room button) to 0 (local button).

In the Web-UI of the P44-DSB-X you can click the info-button with Cmd or Ctrl held down to get a tree view of the device's properties to verify the settings are correct.

Best Regards,

Lukas


> On 07.12.2015, at 14:13, Lukas Zeller <luz_...@plan44.ch> wrote:
>
> [...]

Sascha Volkenandt

unread,
Dec 8, 2015, 7:36:36 AM12/8/15
to plan44_vdcd, sas...@akv-soft.de
Hi Lukas,

wow, that was fast :-)

I'll try this ASAP, but cannot promise that will be as soon as your extension :-)

 
This does NOT yet make the button act as a local button, it is still a room button by default. For that, you (or the dSS configurator) need to change buttonInputSettings[0].function from 5 (room button) to 0 (local button).

This is exactly what I expect, since I'm trying to mimic the behaviour of eight GE-KMs with one device. My device has eight channels and eight buttons and is supposed to control the LED spot arrays in our living room.

Regards,
Sascha

Sascha Volkenandt

unread,
Dec 10, 2015, 3:09:48 AM12/10/15
to plan44_vdcd, sas...@akv-soft.de
Hi Lukas,

works :-)

I've just noticed two strange behaviours (although they don't cause errors). Since I'm still having some trouble with my hardware I wasn't able to investigate yet if this is related to the localbutton or if it is a general behaviour:

1. My device (basic output, one button) shows up in the digitalSTROM web interface as "switchable", but in the device settings dialog I can only choose "active" and "deactivated" by radio-button, none of which is selected. When I select "deactivated", it shows up in the list as "deactivated" (ok), but when I select "active", the corresponding column in the list is empty. The device keeps working though.

2. Even though the output is basic, it can be dimmed by a room switch (meaning the vdc sends values other than 0.0 and 100.0 to the device). Is this expected behaviour? If so, how should a non-dimmable device react, i.e. ignore these values or interpret everything other than 0.0 as 100%?

Regards, and thanks for your work :-)
Sascha

Lukas Zeller

unread,
Dec 11, 2015, 6:23:08 AM12/11/15
to plan44_vdcd, Sascha Volkenandt
Hi Sascha,

> On 10.12.2015, at 09:09, Sascha Volkenandt <sas...@akv-soft.de> wrote:
>
> works :-)

Nice to hear! :-)

> I've just noticed two strange behaviours (although they don't cause errors). Since I'm still having some trouble with my hardware I wasn't able to investigate yet if this is related to the localbutton or if it is a general behaviour:
>
> 1. My device (basic output, one button) shows up in the digitalSTROM web interface as "switchable", but in the device settings dialog I can only choose "active" and "deactivated" by radio-button, none of which is selected. When I select "deactivated", it shows up in the list as "deactivated" (ok), but when I select "active", the corresponding column in the list is empty. The device keeps working though.

Real dS terminal blocks have very specific modes, depending on the type of output. For the virtual devices, this was generalized, and a new pseudo-mode "active in default mode of the device" was added, but only recently. I guess there's a small problem in the configurator to display this new mode correctly. But as you said, the output works fine.

> 2. Even though the output is basic, it can be dimmed by a room switch (meaning the vdc sends values other than 0.0 and 100.0 to the device). Is this expected behaviour?
> If so, how should a non-dimmable device react, i.e. ignore these values or interpret everything other than 0.0 as 100%?

There's defined digitalSTROM behaviour for light outputs, i.e. the output must be on when the output value is higher than the outputSettings.onThreshold property. The idea is that by using different thresholds in a series of lights in a room, the overall room brightness can be "dimmed" even if the individual lights are switched - the more you dim up the more lights go on.

For other outputs, the vdcd implementation considers anything different than 0 as "on", and 0 as "off".

I checked the external devices implementation, and so far, the output mode was not properly applied, that's why you saw gradual values for a switched output.

I cleaned this up a bit. Now, if you init a "light" with "dimmable":false, your external device will see either 0 or 100 only. The same for "basic", but here the default mode is switched. You can set it "dimmable":true or "positional":true to allow it working gradually. Outputs that allow dimming can still be set to switched output in the dS configurator, to get the 0/100 behaviour.

At least, that's how it is meant to work, I haven't tested all details yet, but feel free to pull and try these changes from "luz" on github :-)

Lukas

Sascha Volkenandt

unread,
Dec 15, 2015, 9:16:57 AM12/15/15
to plan44_vdcd, sas...@akv-soft.de
Hi Lukas,

my device is now installed in the kitchen and works as non-dimmable, switchable, local button device outputs without any problem :-)

I have noticed one more thing while experimenting:

I am not able to send a button message in simple mode, I am always getting the error message "tag is missing". The message is complete (i.e. "D0:B0=1"). What's weird is, that vdcd reports receiving an empty line after increasing the log level. What's even more weird is, that simple and JSON mode use the same line parsing code in vdcd and JSON works without any problem.

I wanted to use simple mode since the Arduino Json-Encoder is too slow for my concerns (leading to dimming button presses since encoding the "button release" message took too long). Anyway, I am now using JSON again (building the messages with sprintf, which is fast enough), so this is not a problem anymore :-)

Regards,
Sascha

Lukas Zeller

unread,
Dec 17, 2015, 8:37:20 AM12/17/15
to Sascha Volkenandt, plan44_vdcd
Hi Sascha,

> On 15.12.2015, at 15:16, Sascha Volkenandt <sas...@akv-soft.de> wrote:
>
> my device is now installed in the kitchen and works as non-dimmable, switchable, local button device outputs without any problem :-)

Great!

> I have noticed one more thing while experimenting:
>
> I am not able to send a button message in simple mode, I am always getting the error message "tag is missing". The message is complete (i.e. "D0:B0=1").

How does your init message look like? I just did a test and could not see any problem with sending tagged button messages with simple protocol, so it would be useful to have the exact same device definition.

> What's weird is, that vdcd reports receiving an empty line after increasing the log level. What's even more weird is, that simple and JSON mode use the same line parsing code in vdcd

How did you come to that conclusion? IMHO the code paths are quite different for JSON and simple protocol.

> [... ]and JSON works without any problem.
>
> I wanted to use simple mode since the Arduino Json-Encoder is too slow for my concerns (leading to dimming button presses since encoding the "button release" message took too long). Anyway, I am now using JSON again (building the messages with sprintf, which is fast enough), so this is not a problem anymore :-)

Still, I'm curious to find out if there's a hidden problem with the simple text parsing I could not reproduce so far.

Best Regards,

Lukas
Reply all
Reply to author
Forward
0 new messages