-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DMX Input #31
Comments
I don't understand what you are trying to achieve. |
I added the ArtPollReply as context, as this is what I'm doing in the ArtNet server. The ArtPollReply contains universe numbers in its SwIn/SwOut fields, that's how I can discover nodes and other controllers without having to have an IP in advance. The ArtDmx arrow in the sequence diagram should have been from Controller to HA (controller) for this use case. So I receive ArtDmx packets from controllers that control universes that we've previously subscribed to. I wish to pass through your library in the reverse direction: undoing output correction, grouping multiple channels into multi-byte raw values and sending those back to the origin (HA in my case). |
So to be more clear, this is how I thought about setting it up. Please correct me if that's not aligned with your vision for your library. So this would make PyArtNet effectively bidirectional. I can also create a PR to add the ArtNet server into your library, though my current code is way off your coding standard, would need some tidying up first in that case. |
I still am not 100% sure I understand what you are trying to achieve. I think the labels are also a little bit off in your diagram which contributes to my confusion. What exactly is Can you describe what you want to achieve in easy words? |
Sorry I'm not great with text, here's another diagram: ArtNet Server is my code that implements most of the ArtNet standard. Implements the ArtPoll/ArtPollReply mechanism to discover and be discovered, sending and receiving ArtDMX packets, and much more. But yes, this would be an alternative to ArtNetNode (I have this configurable to either use the server, or your direct approach). As a lighting engineer, I would like to use my ArtNet controller hardware to update HA states, so that I can control my house using my hardware. Here's two users asking this: |
That's something I can understand. Imho the most easy solution would be to just have pyartnet accept ArtDMX packages and provide some kind of callback.
This would however require some kind of configuration on the HA side, e.g. input universe 1, channel 1-3 -> ha_entity Would something like this work with HA? |
To be clear, the ArtDMX packets are sent to all nodes and controllers that subscribed to a universe. HA doesn't need to act as proxy.
A callback would be perfect, but I prefer that pyartnet transforms the values into values that HA will understand. I.e. HA sends value 200, cubic correction = 123, 16 bit = 8062868. HA should receive a 200, and not a 8062868. A mapping per universe, per channel will also work for me, yes. My current PR does callbacks on a channel level, the thought was that pyartnet doesn't need to bother mapping foreign HA objects. |
But I don't see this? The response to the
Why not - this would be an elegant solution and would make lots of things very easy. |
This is how ArtNet is supposed to work:
ArtNet Controllers will be sending to Node, nothing we can do about that. We can just choose to also listen to these universes. If HA decides to also send the same DMX frame to Node, then Node would receive DMX frames from multiple controllers, meaning it will go into merge mode, which opens a can of worms. |
I've had the old 2017 version of the ArtNet specification which does not define
How would you set that it in the I still understand |
Ah that explains a bit, we're getting there! :)
Yes Indeed. When
Fields 23 (SwIn) and 24 (SwOut) define the universe number that you wish to subscribe to. Fields 7 (NetSwitch) and 8 (SubSwitch) define the net and subnet of the PortAddress. An ArtPollReply can contain target up to 4 universes in one same net/subnet. If you need more, you're free to reply with multiple ArtNetReply packets.
The subscription mechanism is at the core of this version of ArtNet at least. https://art-net.org.uk/how-it-works/streaming-packets/subscription/ Not only is the ArtPollReply mandatory to be sending ArtDMX packets, not replying to a Poll will result in a termination. If you don't like the need to ArtPoll every 2.5 to 3 seconds, you can set ArtPoll Flags Bit 1 to To be fair, it's not the best documentation of a protocol. :p Btw, you're legally required to put |
So to recap, there's two directions we can take this;
There's no hybrid approach, as only one project can listen to the ArtNet port. But I think, either way, we will need #36 as a way of flowing back to HA. If you prefer option 2, I can submit a PR with the controller as well. Though personally, I prefer to have control over it directly, as I want to expand it with future functionalities (ArtTrigger, ArtCommand, ...) Please let me know what's your take on this. :) |
Context on my end
I'm implementing HomeAssistant as an ArtNet controller. This means it's going poll for ArtNet devices on the network and reply to other ArtNet controllers do the same. This will mean that other controllers will be able to update our state.
Code for the ArtNet server is available. I have yet to clean it up, as it's pretty messy. But it does work! :)
Current implementation on my end
I'm able to bridge my implementation to ArtNetNode (or
BaseNode
in the comingrelease). This just adds the logic that the server needs to start polling, opening sockets, etc... I've set it up this way so that I can keep your error correction and animations, whilst being able to expand on the functionality of ArtNet.This is able to receive ArtDmx packets containing data on the port (net, sub_net, universe), and a
bytearray
of raw data. I'm able to simply override the universe's data, but omits output correction and callbacks.Requested change on your end
The text was updated successfully, but these errors were encountered: