Awtrix 3 Binding (formerly Awtrix Light) [4.1.0.0;5.0.0.0)

Documentation fixes and the multi-color text parsing will be included in OH5.1 :+1:

After updating to OH 5.1 there are doubled entries for adding a device or app:

mqtt:awtrixclock / mqtt:awtrix-clock
mqtt:awtrixapp / mqtt:awtrix-app

Things created before OH 5.1 (think it was the community edition) have been created without the hyphen. In the addon store there is just one Awtrix addon.

Which one is the current one/should I choose for creating new things?

Please use the binding from the official addon repository. Unfortunately the thing ids I was using in the community version were not compliant with the requirements for official bindings. So make sure to remove the old binding (probably you have a jar in your addons folder if it is still there after an upgrade) and create new things with the official binding.

Thanks for clarification. It looks like the current one is the one with the hyphen and translated description. I will re create the things.

I could not find an old jar in the addons folder but it looks like it is somehow still installed:

I will need to have a look in the OH console if I can get rid of the old one there…

Hi, is this Binding removed in openHAB 5.1.4?

Greets

It shouldn’t be, can’t you see in it the addon store?

yes.

I updated to 5.1.4 and the binding is gone..

Ah I forgot: you should only need the mqtt binding. It is part of that now. You cannot install the awtrix binding separately.

so i have to recreate all things again?

If you were using the marketplace version unfortunately: yes. Unfortunately I used thing and channel names that did not comply with the project standards so they had to be changed :unamused_face:

now i cant even look the old config.. the things-page isnt loading..

where can I find the 5.1.3 marketplace version?

The latest marketplace version is linked in the first post of this thread.

thx, its back online.

I have 9 things to recreate. this will take some time.

As I’m trying to adapt the last few bits… :slight_smile:

  1. The action showCustomNotification() does not work as intended.
    this code throws an error:
val awtrixActions = getActions('mqtt.awtrixlight','mqtt:awtrix-clock:mymqtt:awtrix2')
val params = newHashMap('text' -> 'OFFLINE! (' + iCount.toString + ')','color' -> newArrayList(255,0,0),'blinkText' -> '500')
awtrixActions.showCustomNotification(params, true, true, false, "", "", false)

iCount is an Integer

Type mismatch: cannot convert from HashMap<String, Serializable> to Map<String, Object>

so how to setup params to be of Type <String, Object>? I can’t figure it out :frowning:

  1. although all arguments for showCustomNotification should be optional, I have to set all of them or openHAB complains about invalid number of arguments. Maybe because there is no default value for the arguments?
  2. there is no action for to dismiss the notification
    (in mqtt it’s <awtrixclock-topic>/notify/dismiss which has to receive an empty string)

Regarding 1.: I think your code looks fine. Back then I was successfully testing this with this example as far as I remember:

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

I will need to replicate this at home later. Maybe something has changed unexpectedly in the meantime. What OH version are you using?

  1. I would also need to test this or find out how this works internally. The actions I defined only partially have nullable parameters:

public void showCustomNotification(Map<String, Object> appParams, boolean hold, boolean wakeUp, boolean stack,
            @Nullable String rtttl, @Nullable String sound, boolean loopSound) 

So I guess this might be improved in my code with some default values, I would need to figure out how to achieve this. I guess right now you have to provide every parameter.

  1. Yes this action is missing. The reason for me was that there is no way to tell which notification is currently shown on the clock and for how long. However it might still be helpful to just clear any notifications at a certain point in time or keep track of it separately in your rule logic. I will add this feature.

Sorry, missed to give that information… I’m using OH5.2.0 Release Build.

Yepp, but even with the exact code I’m getting this strange error. Seems that newHashMap() will create a Type HashMap<String, Serializable> instead of Map<String, Object>

@DrRSatzteil Did you see that there is a successor for Awtrix3 (Awtrix-NG)?
There were some API changes, so it’s incompatible to Awtrix3, sadly, but it is what it is.

No I actually never heard of it but I will have a closer look at some point.

EDIT: just had a quick look. A lot of it seems very similar. However it offers an option to remove notifications by name which is a nice improvement. Have you noticed any other advantages?

Here are some dedicated migration topics listed: Migrating from AWTRIX 3 - AWTRIX NG