ylabonte/proconip-hass

DMX control for RGB lights

FipsJr opened this issue · 5 comments

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

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

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.

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)

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

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

  • HA: POST change for CH01 (internally sets new status of CH01 in HA)
  • ProCon.IP: Apply change for CH01

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

  • HA: GET DMX status

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

  • HA: POST change for CH02 (internally sets new status of CH02 in HA)
  • ProCon.IP: Process GET status request and queue the change for CH02 until status request has been processed
  • ProCon.IP: Respond to GET status request (response only conains the changed CH01. CH02 is unchanged, because the change will be processed afterwards)
  • HA: Updates its staus according to the GET Status response
    ...
    from here on, HA will reset the value of CH02 when trying to update the value of CH03.

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. 😉

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...