I implemented ArtNet support and status update for items, JAR is here
Since I do not own ArtNet devices, please somebody check if that is working. Wireshark at least tells me that I produce valid ArtDMX packets, not sure if something around that is missing. Iām aware of the fact that the sender should check with a ArtPOLL packet if the receiver is there, however this is not implemented at the moment and not top-priority for me.
Another thing: I did take a look at OLA. There is a library that is used for communication with OLA. It would be easy to implement an OLA bridge if this library is EPL compatible. It is licensed under Apache License, Version 2.0, if I understand 30. What licenses are acceptable for third-party code redistributed by Eclipse projects? right, there should not be a problem. Can someone confirm that (probably @kai?)
@SpaceGlider: I did take a quick look, OSC has nothing to do with DMX?
my ArtNet devices operate on universe ā0ā which seems forbidden by the implementation. Could you add the possibility to use universe 0?
It would be very nice to have a small documentation on how to setup things, talk to channels through items etc. I looked through the github but I could only find hints in the code. Maybe I also overlooke something?
Yes, OSC is not directly related to DMX, but used in a similar context (lighting control, music etc). If openHAB had an additional OSC binding to talk to OSC devices or receive messages from OSC controllers, this would be a great addition.
I am keen on testing it after the holidays. Is there a small wiki page on how to do the ip-addresses/configurations? I really donāt want to use the broadcast with my artnet nodes any longer. I have one of them also running in universe 0.
ArtPOLL is definately not a priority.
I have checked the ArtNet spec and unlike the E1.31 spec for sACN, universe counting starts at 0. Since the implementation uses 1 as default universe, I have decided to reduce the universe number by 1 before sending them to ArtNet nodes, i.e. you have to use universe 1 in all configurations (like channel 1) but youāll get universe 0 on the output. This is much like the āoldā problem with stage dimmers that usually use 0 as first channel while slot 0 in the DMX protocol is the start code and channel values start with slot 1. Iāll build a new JAR this evening.
A documentation has been added. If you find something inaccurate or missing, please tell me. Sometimes itās hard for the developer to write a good documentation.
Hi Jan,
thanks for the update! The documentation is helpful, but I am still struggling with it. I have stuck to the documentation and used the examples, but my this:
Does not get initialized. Also what is unclear to me is how the dimmer-things are linked to the bridge.
When I create the Bridge and the Thing through PaperUI, everything is there (initialized), but my light does not yet switch on (however, this could be an issue on the receiver end, I will investigate further).
ipAddress is wrong in the example, it is address, as stated in the bridge description above. Iām not sure if universe="1" or universe=1 is correct, Iāll check that.
At the moment things are not bound to bridges. Thje bridges are more like āoutputā devices. There are ups and downs to this approch.
Pro:
A thing can contain DMX channels from different universes. Since a bridge is always for one universe, this is not possible if things are bound to bridges.
A universe can be send out to different devices, i.e. you can send universe via ArtNet to one node and use E1.31 multicast for the same universe without duplicating the things. You can also send e.g. the same ArtNet package to different nodes.
If needed, you can change the output by simply adding a new bridge for this universe and deleting the old one. No need to change anything in the things.
Cons:
The user needs to keep track of the universes. If the thing is bound to a bridge with a fixed universe, the universe is determined by the bridge.
The coding is more complex and more checks are needed.
The configuration differs in this binding from the other ones.
Some things can be worked around. E.g. it would be quite easy to enhance the bridge configuration in a way that you can define more than one receiver node. However, the restriction is still that you canāt send the same universe to different bridges. Iām not sure if someone needs that. Since changing the bridge only requires another selection from a dropdown menu in the thing configuration and not a complete thing setup, this maybe is a minor problem.
The only thing that is not possible is cross-universe things. While this is probably not a problem for dimmers, it may be for chasers. It would be great if someone with a larger DMX setup could comment on this. Is anyone using more than one universe at the moment?
Iām open to suggestion. Itās maybe 2-3h of work to change from the way it is now to the other approach.
I am still not very fond of the concept of defining fades (dynamic) in the item configuration (very static).
Would you kindly consider creating an action which allows posting fades to channels directly?
It would mean much to me since I wonāt have to restart openhab everytime I want to change a fade.
I like the custom action idea. However, I have no idea how to implement that in ESH. If someone can point me in the right direction, that would be great.
You can already change the fade configuration (at least channel values and their timing) in chaser things via the control channel. Bind that to a String item and write a configuration string to that item. Your thing will get updated. It is not possible to change the DMX channel configuration at the moment. If you configure vial Paper UI, only the thing that changed itās configuration will be updated.
Another thing where I need help: I canāt manage to update a dimmer item to the correct state. The item state changes from OFF to ON if I increase the value from 0 to a higher value, but it will not change back to OFF when the value is 0 again. Sending OnOffType.OFF doesnāt help either. Any idea?
Hi @jan_n_klug
wow I am impressed by the fast pace of your development!
I am on christmas vacation now so I will be back testing in January. I will also try to think about the general layout. So far I really like the direction this is going!
I added Lib485 support, so all supported output devices from the OH1 binding should be supported. Since I donāt own or even know of a device that supports Lib485, please test that if you do.
Currently Iām stuck at two things:
I have no idea how to add custom actions and havenāt found another ESH binding that does. If anyone knows how to do that, please let me know.
I canāt get the tests to run. I get an error and have no idea how to fix that:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.23.1:test (default-test) on project org.eclipse.smarthome.binding.dmx.test: Execution default-test of goal org.eclipse.tycho:tycho-surefire-plugin:0.23.1:test failed: Invalid extraRequirement jar:slf4j-api:0.0.0: Unknown artifact type "jar" -> [Help 1]
The tests are basically generated by the script with some additions along the lines of the Hue binding.
I got the tests running and found some corner cases where the code failed. This is fixed now. I have created a PR for review in ESH, please continue testing this version.
As this is my first post, I hope Iām doing everything right .
Jan, thank you for picking this up. I intend to use DMX some day with OpenHAB2 and although I wasnāt aware that the current binding aināt working with OH2 this is a nice move forward!
As I want to use an Artnet interface from Enttec Iām glad you implemented that too! However, I saw you donāt have an interface yourself. Can I help you by lending you one? Your name looks Dutch so just curious whether or not you are from the Netherlands .
Hello @J-N-K . Itās working with art-net. So it was a problem on the receiving end. Somehow always 32 channels are being sent as a minimum, correct?
Also, it seems that after playing with the Things file, the Raspberry Pi needs to be rebooted for the changes to have effect. Is this behaviour intended or normal?
Also great that universe 0 is actually 0 now
I think there are some errors in the documentation about the Things / Items, there is a ā:mybridgeā missing, correct?
Also, it seems that dmx data is constantly being sent. is this correct? How would I switch it off?
I will keep on testing and report back any problems if I can find them. Cheers!
True. 24 is the minimum needed for correct timing on DMX512A transmitters, I increased the limit a bit. This should not hurt-
Which version do you use? I have oberserved that problem before (but restarting OH2 was enough). This did never happen when I used the PaperUI for configuration, so I guess this is not related to the DMX binding. I think with the things enclosed in {} after the bridge configuration :mybridge is not necessary. But you are right, the documentation needs an update.
[quote]
Also, it seems that dmx data is constantly being sent. is this correct? How would I switch it off?
/quote]
What do you mean by āconstantlyā? Sending about once a second (actually 800ms) is the lowest possible frequency allowed by the standards.
@Dennis1984120, @SpaceGlider has an ArtNet interface, and it seems to work. Just install the binding and see if it works for you. Oh, Iām from germany, BTW.
yes, restarting OH2 is needed somehow. Maybe this is new in the latest OH2, before I only changed the .things file and OH2 would read it again and create the thingsā¦
My question should have been: Is it possible to turn OFF a bridge completely and not send anything at all? I have multiple inputs to the receiving device and donāt want to interfere.
Hi @J-N-K I saw that you have updated the Binding with applycurve!
May I suggest to put a āswitchā channel to the bridge-things to turn output ON or OFF? I think this would be much mor straight forward than adjusting the output frequency to zero.
I still have occasional flickering (~1s of brighter leds) when the output value is in the lower range but this may be a problem at the receiving end again, I will investigate this.
When will the binding go into the OH2 addons? I think this is at a stage where a snapshot release is more than justified! I use it everyday now and within rules, plannng to add more devices and am very happy with the result. Big thanks for the nice development!