Awtrix 3 Binding (formerly Awtrix Light)

Yes, rainbow affects the whole text as stated in the Awtrix docs. Same for gradient I think.
If you want to also support gradient it would be best to have it in a separate channel since also in the Awtrix API it is not included in the text.

Sorry, just saw that gradient is already supported by channel gradient-color.

Hi,

Use this binding to display status of my home-photovoltatic-system. I do this using scripts, which issue MQTT-topics. Works well for me :slight_smile:

Thanks for this addon!

Best regards,

Florian

1 Like

Are you already on OH5? I have a compiled jar with this feature for OH5 but I do not have an OH5 instance myself yet :see_no_evil_monkey:

If you’re adventurous I could give you this version but I couldn’t test this at all so far :sweat_smile:

I will test this as soon as I’ve upgraded to to OH5 but I don’t know if I will be able to do that before I’m on holidays starting next Monday.

If you’re adventurous I could give you this version but I couldn’t test this at all so far

I have a test instance with OH5 running and could give it a try. Just need a few explanations what syntax is expected.

Ok sure. I will upload the jar tonight and will provide you with a download Link. I used your proposed html syntax but I can also give an example with the download link. I liked the idea that the same item can also be displayed correctly in a widget :smiling_face:

You can try this jar:

Download

Usage should be like:

This is a <font color="#cc33cc">Multi</font> Colored <font color="#34ab12">Text</font>!

When the binding detects font tags in your text all other text effects will be overridden, so no blinking, fading, rainbow fading or color gradients. Nested tags are not allowed. No additional switch required, I think it is very unlikely that one would actually want to display on the clock…

EDIT: Forum killed my tags… So second try :smiley:

Thanks for the fast update!

In principal it works but the spaces around the coloured text have been gone. Looks like it’s getting trimmed. Even if I insert additional spaces:

awtrix

Another interesting thing that there are double entries for device and app in the manual thing creation:
image

(The app was not installed on this instance before trying out your jar and I cleared the cache after updating from milestone to release version of OH5)

Wow, I’m impressed. First try, almost nailed it :smiley: If you want, you try the updated build under the same link above.

Ok, your second finding is interesting… I haven’t changed anything regarding the thing configuration :face_with_raised_eyebrow:

Now there is a NULL instead of a space :wink:
awtrix

For the second thing I am unsure if it is related with your update since I havent used your Awtrix bundle on this test installation before.

Ok apparently now I broke all non coloured segments… that’s not really an improvement I guess :sweat_smile:

I will look into that and setup some test cases to make sure that this works as expected…

1 Like

You may test again. After giving up on my regex based approach and switching to a string parsing approach it seems pretty stable now. There is no real html parser in the dependency tree and I don’t want to suggest to introduce a new dependency here. It works well for all my test cases so I guess it should be fine to use this poor mans html parser approach.

Unfortunately the latest version from 2025-08-04 shows the original text with html tags. I could not find an additional switch for parsing, so I think something seems to be wrong with you parser approach.

Ok sorry for that. I could not find the time to test this on an actual clock so there might still be some other issue. I’m on holidays now and will continue here once Iā€˜m back home.

EDITED (from a question about setup - but after much experimentation, solved it):

Recommend the Things docs are updated to be more like

Bridge mqtt:broker:myBroker [ host="localhost", port=1883 ]
{
   Bridge mqtt:awtrix-clock:myBroker:myAwtrix "Living Room Display" (mqtt:broker:myBroker) [ basetopic="awtrix", appLockTimeout=10, lowBatteryThreshold=25 ] {
      Thing awtrix-app clock "My Clock App" [ appname="clock", useButtons=true ]
      Thing awtrix-app weather "My Weather App" [ appname="weather" ]
      Thing awtrix-app calendar "My Calendar App" [ appname="calendar" ]
      Thing awtrix-app custom "Custom App" [ appname="custom" ]
  }
}

to show the nesting nature of how the awtrix-clock needs to be nested inside the broker bridge. The current docs make it look like the atrix-clock is a sibling to the broker.

Also - change the names of the custom apps to not look like the native apps as it is a bit confusing until reading that you can’t manipulate the native apps

1 Like

The docs for notifications are incorrect?

Setting an array like this in rules DSL is invalid syntax for OH5 at least

val params = newHashMap(
    'text' -> 'Custom Message',
    'icon' -> 'warning',
    'color' -> [255,165,0],  // Orange color
    'rainbow' -> true,
    'duration' -> 10
)

gives log

Configuration model 'awtrix.rules' has errors, therefore ignoring it: [15,24]: missing ']' at ','

[15,30]: mismatched input ']' expecting ')'

[16,26]: mismatched input ',' expecting 'end'

I’d raise a PR for the docs, but trying to set color as newArrayList() or as a string #FF0000 also fails (the hex string is valid in Awtrix MQTT) - the color property is not set in the outbound MQTT message.

Playing a custom MQTT message via MQTT Explorer with the hex code works. This is to say Awtrix 3 accepts it, but the binding seems to have a bug here.

Please note that the outbound message is constructed depending on all other properties. So if you set rainbow to true the color value won’t be transmitted as it is not supported by the clock to use both rainbow and color properties at the same time.

ah! makes sense.

But this is the sample from your own documentation :wink:

image

(which also has illegal syntax for setting the array)

Yeah I got that :sweat_smile: sorry for that. I will correct this after my holidays :grimacing:

1 Like