Dobiss lights integration

for now there’s no config for outputs. every output is a light. but I will add config to indicate which output is dimmable. and which output is maybe a socket or something else like that. for now they are all lights though.

And they are retained because that’s how the device manager works in hass. If you run the node directly you can change it so the config emitted is an empty string. That will then clear it from the device registry normally. That will remove all of it from home assistant. (have not tested this before). But this is why I warned to do 1 relay and 1 output for now :stuck_out_tongue:. Just wanted to know if the polling and the on/off behavior worked. Which it does. Great :slight_smile:

Next up then is config per output so that an output can be made dimmable.

oh ok
yeah, i commented out everything
except your first output “berging”, in my case its “bureau” , but whatever
and also commented out all outputs , except for “nachthal”

so it created 2 lights now to test
berging is actually correct
but if i turn on “nachthal”, in my case it turns on the 7th light on my second relay module??? how can that be
thank god it was our bedroom, and not the one from the children :slight_smile: , especially at this time :slight_smile:

oh, and btw, if you want more stuff to control, i also have the commands to read out the light cell, also the programmations, seems those are not documented in that .pdf

also about the entitys, indeed it creates duplicates every time i start the container :slight_smile:

All documentation is welcome and definitely when you have example input / output messages for the socket protocol.

I don’t understand about the 7th output on the second relay. I’d be interested to see logs for that. But maybe tinker less at this time with something as untested as this haha. Would not want to wake your kids.

Normally it should not create duplicates just when you restart. But it might create duplicates if you change the name. Not sure how the device manager handles changing a name. All dobiss2mqtt does is send an updated config the the exact same unique id.

If you restart the container without changing the config it should not create duplicate entities in any case. As I have restarted it countless times.

ok, yeah it can be because i changed the config
but ok, now i understand your config …
so those first 12 entitys, those are the 12 lights on your first relay 1?
and those other 6 , like nachthal, office, those are 6 lights on your relay nr 2 ?
you dont need to configure number: 2 in that code? is it auto indexing?

so it needs to be configured like below in future?

    modules: [
        {
            // For now only "relay" works. So we can only turn outputs on or off.
            // But these might be supported in the future: "dimmer", "0-10v"
            type: 'relay',
            // Either manually set the number of the relay or let dobiss2mqtt set the number automatically
            // depending on the order if the module in the array.
            number: 1,
            // The outputs (or lights in my case) are just represented as strings which are used to
            // give them their names.
            outputs: [
                "TESTberging",
                "TESTkoele_berging",
                "TESTwc",
                "TESTinkomhal",
                "inkomdeur",
                "salon",
                "eetplaats",
                "keuken",
                "terras",
                "badkamer",
                "master_bedroom",
                "dressing" 
            ]
        },
        {
            type: 'relay',
			number: 2,
            outputs: [
                "nachthal",
                "office",
                "fitness",
                "traphal",
                "zolder_1",
                "zolder_2",
            ]
        },
        {
            type: 'relay',
			number: 3,
            outputs: [
                "xx",
                "xx",
                "xx",
                "xx",
                "xx",
                "xx",
            ]
        },		
    ]
}

Correct.

You also don’t have to add the numbers in the modules either. When I make outputs more configurable I will allow optional overriding of the address there as well. But right now the address is picked up from the order of the array.

for lightcell:

Header ‘c’ ‘2’ instead of ‘c’ ‘0’

**HEADER** **1** **2** **3** **4** **5** **6** **7** **8** **9** **10** **11** **12** **13** **14** **15** **16**
0xED 0x63 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xAF 0xAF

Body 86 (0x56) en 0, filled to  48 bytes.

for pogrammation: , address 87 , second byte is the number of programmation in maxtool

ok , clear, then its strange the wrong light was turned on while testing
also noticed when testing that suddenly the state of all my dimmers were ON, while they were just off, verry strange, also something not correct there either :slight_smile:

ok but this will be something for another time. thx for testing :slight_smile:

indeed, but it turned on a light, step by step :slight_smile:

you are not gonna make it in python? so have it at the end as a custom component?

@pergola.fabio it’ll be mqtt protocol only for now. I like the mqtt integration because this way it’s not locked into home assistant. Other systems could integrate with it like this. But maybe once everything is working nicely I could convert it to python to make it an official integration.

@pergola.fabio and @rmeekers, when using dimmers, do you receive a value between 0 and 99 if you ask for the state of that output through the socket ? With the dobissreceive.py I mean. Is there any way to read the state of the dimmers ? Could you provide an example of a socket response for a dimmable output ?

I will check later today, but if I remember correctly, I receive hex formats from the receiver…

To send, I believe bit should be in dec …
Also the values go from 00 to 90. … 90 is actually 100%

ok, tested it

to send its actually in decimal, so from 00 … 90 , best to round insteps of 10 , so sending values like 00 , 30 … 90 => 90 => is actual 100%
i converted my input_number like this : {{ '%02.f'%((((states('input_number.dimmer4') | float / 255 ) * 90) // 10) * 10) }}
to receive , its presented in HEX format , so from 00 to 5A

Thx. Great that we can receive the dimmed state as well. I’ll see what I can do to support dimmers for SX Evolution.

I’ve got your docker working with an ambiance installation.
thanks for your work!
It have been working great for a few weeks.
But since a few days the state of the lights isn’t working anymore.
If I turn on a light in hass it’s going on but the state turns to off directly while the light keeps on.
I checked the logs and got the same error a lot.

‘(node:19) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [MqttClient]. Use emitter.setMaxListeners() to increase limit,
Error: connect ECONNREFUSED 192.168.1.9:10001,
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {,
errno: -111,
code: ‘ECONNREFUSED’,
syscall: ‘connect’,
address: ‘192.168.1.9’,
port: 10001,
},’

I tried to restart the server but that didn’t work.

I turned the power off and on for the dobiss installation and now it’s working again.

yeah i had this too a while ago when testing my tcp commands
maybe the docker is hammering the controller so it locks up

Cool that you are running it ! You can try increasing pollIntervalInMs. I have it set at 1000ms but I only have 2 modules. And for me this works reliably. If you have more modules it might be too low.

I could build something to guarantee we leave x amount of time between every interaction with the dobiss hardware to not spam it. Right now I make sure to never send more than 1 interaction at the same time.

Do you also use the dobiss apps ? Because they also spam the controller for the state. If 2 things spam at the same time it might cause a lockup as well.

Hey @spobo

Is it possible to make some kind of telnet connection to the dobiss controller and listen for commands?
I want to make somekind of python script that listens on tcp commands … Like example here:

We are already making a socket connection to the controller and sending it commands. But every command has a single response. We send commands like toggle this output on this relay to on for example. And it then replies with some message that it worked. But what are you trying to do exactly? Listen to presses on the switches?

i want to make a socket connection to retrieve the state when i switch something one with my classic switches on the wall, now i have a script that i fire every x sec …
so every time i make a new connection
just wanted to make one connection , so i can use a custom component