Should be supported for SX & Ambiance PRO. Verified with the Fake dobiss interface that dimming protocol towards HASS is supported correctly.
[#A] Implement Convict for the config
Also rework how we do the config.
Have modules. Every module should have a type. relay, dimmer or 1-10v. moods ? Every module type can have another mechanism to ping the states. I don’t think we can ping moods.
Every module has multiple outputs. We should be able to enter unused slots.
Now that convict is in place it should be easy. It’s mostly documentation and adding the yaml parser. It will increase the size of the docker container though.
Updated readme. Docker container is running but homeassistant is not really working well right now ? Seems like zigbee2mqtt is also not working.Had to emit an identifier per output.
It’s now hardcoded to 500ms.
Added: POLL_INTERVAL_IN_MS=500
Normally I test but it is a bit of a pain with RxJS.
I notice that a single CAN Programmer can only have a single active socket session. The Dobiss app also uses a socket connection to check the states of the lights. So it’s important to not hog the socket connection if it’s not needed. That said, it’s kind of needed because we need to constantly ping the CAN Programmer to check the state of the relay outputs.
This way we will ensure we do terminate every socket request after a while. Even if the CAN Programmer is left hanging.
It will probably crash the whole process though as there is no work done for automatic restarting of the observables.
But that’s probably not a bad thing. If the socket is not working your docker process shouldn’t pretend to be stable.
And thus allowing configuring different protocols. I can create a kind of facade which has the exact same API for both protocols. index.ts just consumes whichever one is configured.
Will need some refactoring for this first.
I’ll probably have to hook hardware into the TCP loops for the switches. Then I can intercept the keypress messages per switch. This will then allow me to expose those switches as real switches in mqtt.
So it’ll probably be another project which has to be deployed on ESP modules.
Should use this protocol: https://www.home-assistant.io/integrations/device_trigger.mqtt/
[#C] look into restarting/dropping requests automatically when things go away (like the socket or mqtt)
The state for an output in particular needs to be fully reset. If we fail to emit a state we should also not mark that new state as the last known state. We should keep retry sending that new state.
For now though everything crashes and the whole process is stopped. If the docker service is restarted then we should retry it anyway.
We can make it live reload for shits & giggles. Might be nice when you are finetuning your configuration.
If we do this then we need to make sure to somehow re-emit the config when we update it. And if we remove an output then we should emit blank config for that output so that Home Assistant can remove the device / entity.
We could also store the config somewhere per device which we last emitted. When we notice config that is no longer there we need to also send an erase config message.
Get https://volta.sh working properly
It’s in package.json but I don’t really see it working yet on my machine.
We can do this by having a file which is written on every non-avoideable error that is handled.
Let’s say a socket request timed out. Or a publish is not working on MQTT.
We can retry the socket request or retry sending the message on MQTT. But we should also update that file.
Then we can create a HEALTHCHECK script which will read the file and see if it exists. If so, delete it and mark us unhealthy. If it does not exist we are healthy.
It might do something like this. And we could then re-emit all the config we have.
Can it be done through CAN Programmer ?
Can it be done through CAN Programmer ?
Can it be done through CAN Programmer ?
Can it be done through CAN Programmer ?
Can it be done through CAN Programmer ?
I see that it is module of address 0x53 for Dobiss SX. Maybe it can also be used to poll the moods ? Although it kind of just turns on and the state is not really kept.
hierbij info voor lichtcel , zelf nog niet getest… want ik gebruik hem niet voor HA
Je moet dan in de header ‘c’ ‘2’ sturen ipv ‘c’ ‘0’ (ascii codes)
HEADER 0xED 0x63 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xAF 0xAF
En dan in de body 86 (0x56) en 0, aangevuld tot 48 bytes. –> message3 = binascii.a2b_hex (“ED63320000000000000000000000AFAF5600FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF”)
ok, even getest, ik krijg dit als string terug
60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
is hex, dus 60 komt overeen met momenteel 97% licht sterkte
What I mean is that if we set 1000 and that we have 2 modules that we make sure to poll the second module only 500ms after the first one. This way we spread the load a little more and we don’t spam the controller for multiple modules one after another.