ylabonte / proconip-hass

Home Assistant integration for the Pool Digital ProCon.IP swimming pool control system. All relevant pool controller info as sensors in Home Assistant and various options to switch all relays as desired.
MIT License
3 stars 3 forks source link

DMX control for RGB lights #61

Open FipsJr opened 2 months ago

FipsJr commented 2 months ago

Checklist

Is your feature request related to a problem? Please describe.

I need to access the ProCon webinterface to control the RGB channels of lights connected via DMX.

Describe the solution you'd like

It would be nice if the DMX functionality would be available to control e.g. two separate RGB lamps via color picker or color changing script by Setting the color channels.

Describe alternatives you've considered

No alternative so far Screenshot_20240508_064252_Chrome

Additional context

Screenshot_20240508_064133_Chrome

ylabonte commented 2 months ago

I could try to implement the DMX channels as number entities. This way you could set the channels via Script or define Scenes in HA... But I don't see an easy way to group those channels in HA as RGB channels to be nicely displayed with color picker.

Would that be satisfactory for you?

In advance: I can't say at the moment when I will find the time to implement this.

FipsJr commented 2 months ago

Target URL http://192.168.x.x/usrcfg.cgi

e.g. set RGB lamp 1 and 2 to white

POST to target URL: TYPE=0 LEN=16 CH1_8=255,255,255,255,255,255,0,0 CH9_16=0,0,0,0,0,0,0,0 DMX512=1

(All 16 channels habe to be sent)

FipsJr commented 2 months ago

To get the current DMX values: GET: http://192.168.X.X/GetDmx.csv

ylabonte commented 2 months ago

I know. I'd to check how it could be done before I could reply for the first time... Nevertheless, the implementation requires some effort. I first have to complete an update of the library that can handle the DMX endpoints before I can extend the HA integration.
The fact that you always have to send all the values is also more than suboptimal. The customization alone will double the requests needed to keep the status up to date. Leaving this aside, there is actually no problem implementing the DMX channels as number entities in HA... However, if you want to use them sensibly, you will probably also want to define scenes in HA in which several channels are assigned certain values (e.g. to set a color). HA transfers each change (i.e. each channel) to the integration individually. This results in a race condition due to the regular status queries:

Assume an RGB lamp with RGB channels CH01, CH02 and CH03. Now you want to set a color

So far, all fine... but what, if the regular status update interval comes in here...

HA will still keep sending its changes, not waiting for a response of the regular status update

This does not have to be the case, but there is an increasing likelihood that it will happen the more changes are made in HA at the same time or in close succession.

I can try to workaround the problem, but this will cost additional effort... and with all this in mind (and no self-interest on the DMX functionallity) I wanted to know, if the pure number entity implementation would be satisfactory for you. Because if it's not, I'd like to save myself the work right from the start. 😉

ylabonte commented 2 months ago

Please don't get me wrong. I am willing to implement this... I just want to make sure that you don't think it's that easy and understand why it doesn't work as smoothly as you might have imagined. So if it helps you, even if it's not perfect in the end, I'm happy to implement it...