Awtrix 3 Binding (formerly Awtrix Light)

Still can’t see it. :frowning:

Please check your marketplace setting, it is unpublished AFAIK

Hmm… I never had this option activated.
however… it doesn’t change anything, the binding still isn’t visible.

I will restart openHAB (but not until tomorrow) maybe this will help…

It has a published tag so it should not be necessary.

My instance is restarted every night for backup so this might have fixed it for me

Sorry, my bad, thought it did not.

After a complete restart, the Addon is back in the list…

I should have done the restart two days ago… :woozy_face:

1 Like

I have the same problem with the Twinkly binding. I cannot find the addon in the addon store. A restart did not solve it for me this time. Maybe I have better luck tomorrow :sweat_smile:

I “solved” this problem by opening the community marketplace settings in the UI and saving them (without changing anything). After that I could find the Twinkly binding. No idea why this happens but if anyone else cannot install this binding please try this first.

1 Like

I just gave the windsurf IDE from Codeium a try to find out how well their AI called Cascade really is. I just let the AI create a README for this bundle and though it is not perfect I’m pretty impressed. Initially I copied the README of the espmilight binding and then asked Cascade to improve it. Here is what happened:

Me

Can you please rewrite this open README.md file so that it matches the contents of this awtrixlight bundle?

I'll help you rewrite the README.md file for the MQTT Awtrix Light bundle. First, let me gather information about the bundle's contents and structure.

Let me first look at the current README.md content:

Analyzed

README.md:(1-101)
Now let me search for relevant code in the bundle to understand its functionality:

Searched codebase

242 results
Based on the code I've found, I can see this is an MQTT binding for controlling Awtrix 3 LED matrix displays. Let me write a new README that better reflects the actual functionality:

Edited
README.md
+76
-195
 25
Open diff
I've rewritten the README.md file to accurately reflect the MQTT Awtrix Light binding's functionality. The new README includes:

A clear introduction explaining what the binding does
Supported Things types (awtrixclock bridge and awtrixapp)
Prerequisites for using the binding
Detailed configuration parameters for both bridge and apps
Available channels for both bridge and apps
A complete example showing how to configure things and items
Information about discovery functionality
Available actions and how to use them
The new README is much more focused on the actual Awtrix Light functionality and removes all the irrelevant content about Milight/ESP8266 that was in the previous version. The structure is clearer and provides all the necessary information for users to get started with the binding.

And here is the actual result:

MQTT Awtrix Light Binding

This binding allows you to control Awtrix 3 LED matrix displays via MQTT. The Awtrix 3 is a customizable 32x8 LED matrix display that can show various information like time, weather, notifications and custom text/graphics.

Supported Things

This binding supports two types of things:

Thing Type Description
awtrixclock (Bridge) Represents an Awtrix 3 display device. Acts as a bridge for apps.
awtrixapp Represents an app running on the Awtrix display. Apps can show text, icons, notifications, etc.

Prerequisites

  • An MQTT broker (the MQTT binding must be installed and a broker configured)
  • An Awtrix 3 LED matrix display configured to use MQTT

Thing Configuration

Bridge Configuration (awtrixclock)

Parameter Description Required Default
basetopic The MQTT base topic for the Awtrix device Yes “awtrix”
appLockTimeout Timeout in seconds before releasing app lock No 10
discoverDefaultApps Enable discovery of default apps No false
lowBatteryThreshold Battery level threshold for low battery warning No 25

App Configuration (awtrixapp)

Parameter Description Required Default
appname Name of the app Yes -
useButtons Enable button control for this app No false

Channels

Bridge Channels (awtrixclock)

Channel Type Description
brightness Dimmer Display brightness
power Switch Power on/off
batteryLevel Number Battery level (if applicable)
wifiSignal Number WiFi signal strength
temperature Number Device temperature

App Channels (awtrixapp)

Channel Type Description
text String Text to display
textCase Number Text case (0=normal, 1=uppercase, 2=lowercase)
icon String Icon name to display
color Color Text color
background Color Background color
rainbow Switch Enable rainbow effect
duration Number Display duration in seconds
lifetime Number App lifetime

Full Example

Things

Bridge mqtt:broker:myBroker [ host="localhost", port=1883 ]
Bridge mqtt:awtrixlight:myAwtrix "Awtrix Display" (mqtt:broker:myBroker) {
    Thing awtrixapp clock "Clock App" [ appname="clock" ]
    Thing awtrixapp weather "Weather App" [ appname="weather", useButtons=true ]
}

Items

// Bridge items
Dimmer Display_Brightness "Brightness [%d %%]" { channel="mqtt:awtrixlight:myAwtrix:brightness" }
Switch Display_Power "Power" { channel="mqtt:awtrixlight:myAwtrix:power" }
Number Display_Battery "Battery [%d %%]" { channel="mqtt:awtrixlight:myAwtrix:batteryLevel" }

// Weather app items
String Weather_Text "Weather Text" { channel="mqtt:awtrixlight:myAwtrix:weather:text" }
Color Weather_Color "Weather Color" { channel="mqtt:awtrixlight:myAwtrix:weather:color" }

Discovery

The binding can automatically discover Awtrix devices that publish their status to the configured MQTT broker. Once a device is discovered, it will appear in the inbox. Apps can also be discovered if discoverDefaultApps is enabled on the bridge.

Actions

The binding provides actions to control special features of the Awtrix display:

  • blinkIndicator(int indicatorId, int[] rgb, int blinkTimeInMs): Blink an indicator LED with specified color and duration

Example:

val actions = getActions("mqtt.awtrixlight", "mqtt:awtrixlight:myAwtrix")
actions.blinkIndicator(1, [255,0,0], 1000) // Blink first indicator red for 1 second

And after a few hints for improvements I got this. The question is now as always with AI features: Will it be faster to just write that myself or to review all of this properly? :smiley:

MQTT Awtrix Light Binding

This binding allows you to control Awtrix 3 LED matrix displays via MQTT. The Awtrix 3 is a customizable 32x8 LED matrix display that can show various information like time, weather, notifications and custom text/graphics.

Supported Things

This binding supports two types of things:

Thing Type Description
awtrixclock (Bridge) Represents an Awtrix 3 display device. Acts as a bridge for apps.
awtrixapp Represents an app running on the Awtrix display. Apps can show text, icons, notifications, etc.

Prerequisites

  • An MQTT broker (the MQTT binding must be installed and a broker configured)
  • An Awtrix 3 LED matrix display configured to use MQTT

Thing Configuration

Bridge Configuration (awtrixclock)

Parameter Description Required Default
basetopic The MQTT base topic for the Awtrix device Yes “awtrix”
appLockTimeout Timeout in seconds before releasing app lock No 10
discoverDefaultApps Enable discovery of default apps No false
lowBatteryThreshold Battery level threshold for low battery warning No 25

App Configuration (awtrixapp)

Parameter Description Required Default
appname Name of the app Yes -
useButtons Enable button control for this app No false

Channels

Bridge Channels (awtrixclock)

Channel Type Description
brightness Dimmer Display brightness
power Switch Power on/off
display Switch Display on/off
batteryLevel Number Battery level (if applicable)
low-battery Switch Low battery warning
wifiSignal Number WiFi signal strength (RSSI)
temperature Number:Temperature Device temperature
humidity Number Relative humidity
lux Number Ambient light level
sound Switch Sound on/off
autoBrightness Switch Automatic brightness control
buttonleft Trigger Left button press event
buttonright Trigger Right button press event
buttonselect Trigger Select button press event
indicator1 String Control first indicator LED
indicator2 String Control second indicator LED
indicator3 String Control third indicator LED
rtttl String Play RTTTL ringtone
screen String Raw screen data
app String Currently active app

App Channels (awtrixapp)

Channel Type Description
active Switch Enable/disable the app
text String Text to display
textCase Number Text case (0=normal, 1=uppercase, 2=lowercase)
textOffset Number Text offset position
topText String Text to display at the top
icon String Icon name to display
pushIcon String Push icon animation (STATIC, PUSHOUT, PUSHOUTRETURN)
color Color Text color
background Color Background color
gradientColor Color Secondary color for gradient effects
rainbow Switch Enable rainbow effect
duration Number Display duration in seconds
lifetime Number App lifetime
lifetimeMode String Lifetime mode
scrollSpeed Number Text scrolling speed
effect String Display effect
effectSpeed Number Effect animation speed
effectBlend Switch Blend effect with background
effectPalette String Color palette for effects
autoscale Switch Auto-scale content to fit display
center Switch Center content horizontally
repeat Switch Repeat animation
blink Switch Blink text
fade Switch Fade text
bar Number Progress bar value
line Switch Draw line
progress Number Progress value
progressColor Color Progress bar color
progressBackground Color Progress bar background color
overlay Switch Enable overlay mode
reset Switch Reset app to default state

Full Example

Things

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

Items

// Bridge items (Living Room Display)
Group gAwtrix "Living Room Awtrix Display" <screen>
Dimmer Display_Brightness "Brightness [%d %%]" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:brightness" }
Switch Display_Power "Power" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:power" }
Switch Display_Screen "Screen" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:display" }
Switch Display_Sound "Sound" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:sound" }
Switch Display_AutoBrightness "Auto Brightness" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:autoBrightness" }
Number:Temperature Display_Temperature "Temperature [%.1f °C]" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:temperature" }
Number Display_Humidity "Humidity [%d %%]" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:humidity" }
Number Display_Battery "Battery Level [%d %%]" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:batteryLevel" }
Switch Display_LowBattery "Low Battery" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:low-battery" }
Number Display_WiFi "WiFi Signal [%d %%]" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:wifiSignal" }
String Display_CurrentApp "Active App [%s]" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:app" }

// Clock App items
Switch Clock_Active "Clock Active" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:clock:active" }
String Clock_Text "Clock Text" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:clock:text" }
Color Clock_Color "Clock Color" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:clock:color" }
Number Clock_Duration "Clock Duration" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:clock:duration" }

// Weather App items
Switch Weather_Active "Weather Active" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:weather:active" }
String Weather_Text "Weather Text" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:weather:text" }
String Weather_Icon "Weather Icon" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:weather:icon" }
Color Weather_Color "Weather Color" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:weather:color" }
Switch Weather_Rainbow "Weather Rainbow Effect" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:weather:rainbow" }

// Custom App items with advanced features
Switch Custom_Active "Custom App Active" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:custom:active" }
String Custom_Text "Custom Text" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:custom:text" }
String Custom_Icon "Custom Icon" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:custom:icon" }
Color Custom_Color "Text Color" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:custom:color" }
Color Custom_Background "Background Color" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:custom:background" }
Number Custom_ScrollSpeed "Scroll Speed" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:custom:scrollSpeed" }
Switch Custom_Center "Center Text" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:custom:center" }
Number Custom_Progress "Progress [%d %%]" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:custom:progress" }
Color Custom_ProgressColor "Progress Color" (gAwtrix) { channel="mqtt:awtrixlight:myAwtrix:custom:progressColor" }

Sitemap

sitemap awtrix label="Awtrix Display" {
    Frame label="Display Control" {
        Switch item=Display_Power
        Slider item=Display_Brightness
        Switch item=Display_Screen
        Switch item=Display_Sound
        Switch item=Display_AutoBrightness
        Text item=Display_Temperature
        Text item=Display_Humidity
        Text item=Display_Battery visibility=[Display_LowBattery==ON]
        Text item=Display_WiFi
        Text item=Display_CurrentApp
    }
    
    Frame label="Clock App" {
        Switch item=Clock_Active
        Text item=Clock_Text
        Colorpicker item=Clock_Color
        Slider item=Clock_Duration
    }
    
    Frame label="Weather App" {
        Switch item=Weather_Active
        Text item=Weather_Text
        Text item=Weather_Icon
        Colorpicker item=Weather_Color
        Switch item=Weather_Rainbow
    }
    
    Frame label="Custom App" {
        Switch item=Custom_Active
        Text item=Custom_Text
        Text item=Custom_Icon
        Colorpicker item=Custom_Color
        Colorpicker item=Custom_Background
        Slider item=Custom_ScrollSpeed
        Switch item=Custom_Center
        Slider item=Custom_Progress
        Colorpicker item=Custom_ProgressColor
    }
}

Rules

rule "Low Battery Warning"
when
    Item Display_LowBattery changed to ON
then
    // Send notification when battery is low
    sendNotification("admin@email.com", "Awtrix Display battery is low: " + Display_Battery.state + "%")
end

rule "Weather Update"
when
    Item Weather_Active changed to ON
then
    // Update weather information when weather app becomes active
    Weather_Text.sendCommand("22°C Partly Cloudy")
    Weather_Icon.sendCommand("weather-partly-cloudy")
    Weather_Color.sendCommand("0,0,255")  // Blue color
end

Discovery

The binding can automatically discover Awtrix devices that publish their status to the configured MQTT broker. Once a device is discovered, it will appear in the inbox. Apps can also be discovered if discoverDefaultApps is enabled on the bridge.

Actions

The binding provides various actions that can be used in rules to control the Awtrix display. To use these actions, you need to import them in your rules:

val actions = getActions("mqtt.awtrixlight", "mqtt:awtrixlight:myAwtrix")

Indicator Control

Control the three indicator LEDs on the Awtrix display:

// Blink indicator 1 in red for 1 second
actions.blinkIndicator(1, [255,0,0], 1000)

// Fade indicator 2 to blue over 2 seconds
actions.fadeIndicator(2, [0,0,255], 2000)

// Turn on indicator 3 in green
actions.activateIndicator(3, [0,255,0])

// Turn off indicator 1
actions.deactivateIndicator(1)

Device Control

Control basic device functions:

// Reboot the device
actions.reboot()

// Put device to sleep for 60 seconds
actions.sleep(60)

// Perform firmware upgrade
actions.upgrade()

Sound Control

Play sounds and melodies:

// Play a predefined sound file (without extension)
actions.playSound("notification")

// Play an RTTTL melody
actions.playRtttl("Indiana:d=4,o=5,b=250:e,8p,8f,8g,8p,1c6,8p.,d,8p,8e,1f,p.,g,8p,8a,8b,8p,1f6,p,a,8p,8b,2c6,2d6,2e6,e,8p,8f,8g,8p,1c6,p,d6,8p,8e6,1f.6,g,8p,8g,e.6,8p,d6,8p,8g,e.6,8p,d6,8p,8g,f.6,8p,e6,8p,8d6,2c6")

Notifications

Display notifications on the screen:

// Show simple notification with icon
actions.showNotification("Hello World", "alert")

// Show custom notification with advanced options
val params = newHashMap(
    'text' -> 'Custom Message',
    'icon' -> 'warning',
    'color' -> [255,165,0],  // Orange color
    'rainbow' -> true,
    'duration' -> 10
)
actions.showCustomNotification(
    params,     // Notification parameters
    false,      // hold: Keep notification until manually cleared
    true,       // wakeUp: Wake up from screen saver
    true,       // stack: Add to notification stack
    "beep.rtttl", // RTTTL sound to play
    "alert",    // Sound file to play
    false       // loopSound: Loop the sound
)

Custom Notification Parameters

The showCustomNotification action accepts the following parameters in the params map:

Parameter Type Description
text String The text to display
textCase Number Text case (0=normal, 1=uppercase, 2=lowercase)
icon String Icon name to display
color int RGB color array for text [r,g,b]
background int RGB color array for background [r,g,b]
rainbow Boolean Enable rainbow effect
duration Number Display duration in seconds
repeat Boolean Repeat the notification
scrollSpeed Number Text scrolling speed
textOffset Number Text offset position
center Boolean Center the text horizontally
fade Boolean Enable text fade effect
progress Number Show progress bar (0-100)
progressColor int RGB color array for progress bar [r,g,b]
progressBackground int RGB color array for progress bar background [r,g,b]
blinkText Boolean Enable text blinking
pushIcon String Push icon animation (STATIC, PUSHOUT, PUSHOUTRETURN)

The action method parameters:

Parameter Type Description
hold Boolean Keep notification until manually cleared
wakeUp Boolean Wake up from screen saver
stack Boolean Add to notification stack
rtttl String RTTTL melody to play
sound String Sound file to play (without extension)
loopSound Boolean Loop the sound

Example Rules

Here are some example rules demonstrating the actions:

rule "Low Battery Warning with Indicator"
when
    Item Display_LowBattery changed to ON
then
    val actions = getActions("mqtt.awtrixlight", "mqtt:awtrixlight:myAwtrix")
    if (actions === null) {
        logError("Awtrix Actions", "Actions not found")
        return
    }
    
    // Blink red indicator
    actions.blinkIndicator(1, [255,0,0], 1000)
    
    // Show notification
    actions.showNotification("Battery Low!", "battery")
end

rule "Weather Alert"
when
    Item Weather_Alert changed
then
    val actions = getActions("mqtt.awtrixlight", "mqtt:awtrixlight:myAwtrix")
    if (actions === null) {
        logError("Awtrix Actions", "Actions not found")
        return
    }
    
    val params = newHashMap(
        'text' -> Weather_Alert.state.toString,
        'icon' -> 'weather-storm',
        'color' -> [255,255,0],  // Yellow warning color
        'duration' -> 30
    )
    
    // Show weather alert with sound
    actions.showCustomNotification(params, false, true, true, "alert.rtttl", "warning", false)
    
    // Activate warning indicator
    actions.fadeIndicator(2, [255,165,0], 1000)  // Orange indicator
end

A question to everyone who is using this binding for displaying notifications:

Currently you can only show notifications via thing actions. Either you go with the basic action that allows you to specify a text and icon or you can use the custom action that takes a map as parameter and in theory allows you to customise notifications just like you can do it with apps already (a couple of properties cannot be used on notifications like lifetime for example). This is however a bit complicated because the input map requires you to use the keys as they are used by the Awtrix 3 firmware. I just realised that while I was writing my documentation.

So the question is: how would you like to use notifications in general?

  • Via Actions (feels natural to me but gets complicated with the many customisation options that should ideally be available)
  • A new Notification thing (unless I add my own persistence layer the channels would not survive an OH reboot, it does feel a bit weird to create a thing for a notification or actually a type of notification that could be triggered via a specific channel)
  • As a thing Action of an app thing itself: the notification could inherit all the settings of the app and could override a few selected properties. If you want a standalone notification you would need to create an app first though.
  • Other ideas?

I use notification as channels in the main awtrix thing.
I set some different notifications and linked to an item.
so I only send value to the item and the notification is showed.
I can show my config if you want.
Greets

Yes please :wink:

I was about to write the same :blush:

I don’t really understand how you do it.

1 Like

Ah sorry. It’s a mqtt thing… :grin::grin:

But it works fine for me.

UID: mqtt:topic:mqttbroker:Awtrix_clock
label: Awtrix clock mqtt
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:mqttbroker
channels:
  - id: notify
    channelTypeUID: mqtt:string
    label: "notify "
    description: ""
    configuration:
      formatBeforePublish: '{"text":"%s","icon":"555","topText":false,"effect":"Ripple","pushIcon":1,"repeat":2,"scrollSpeed":50}'
      commandTopic: awtrix_clock/notify
      postCommand: true
  - id: notify_title
    channelTypeUID: mqtt:string
    label: notify  title
    description: ""
    configuration:
      formatBeforePublish: '{"text":"%s","icon":"17668","color":"0,0,1","stack":false,"topText":true,"effect":"PlasmaCloud","pushIcon":1,"repeat":2,"scrollSpeed":75}'
      commandTopic: awtrix_clock/notify
      postCommand: true
  - id: settings
    channelTypeUID: mqtt:string
    label: settings
    description: ""
    configuration:
      formatBeforePublish: "%s"
      commandTopic: awtrix_clock/settings
      postCommand: true
  - id: playSound
    channelTypeUID: mqtt:string
    label: playSound
    description: ""
    configuration:
      formatBeforePublish: '{"sound":"%s"}'
      commandTopic: awtrix_clock/sound
      postCommand: true
  - id: vol_change
    channelTypeUID: mqtt:string
    label: vol_change
    description: ""
    configuration:
      formatBeforePublish: '{"text":"%s","icon":"56196","stack":false,"effect":"Ripple","pushIcon":1,"duration":1}'
      commandTopic: awtrix_clock/notify
      postCommand: true

Ok yeah that should work as well and there’s nothing wrong about it. However I was of course trying to find a better solution for this binding.

Maybe I can just add a mapping into the action so that the channel names can be used instead of the awtrix firmware attributes…

I’m still using both a mqtt “generic” Thing and an awtrixclock Thing, but I have to admit, that’s because I’m veeery lazy :blush:

One thing, though, is the indicator. Why using a switch channel and lose the ability to change the color or other aspects of the indicator via channels? Of course one can use the actions - just found that option last week, nice.

I thought about that but this would require channels for indicator mode (static, blink, fade), the indicator colour and another one for the blink/fade interval. All of that times three for the three different indicators. I think it is much easier to use an action instead and therefore I offered only very basic indicator logic by the use of channels. I wouldn’t mind adding it though if it would be of use for you.

This binding will be part of the next OH 5.0 Milestone build.

Unfortunately the new version will not be compatible with the marketplace version as I had to change the thing IDs and also quite a few channel names. So if you want to switch to this new version it is necessary to recreate your things and channel links will definitely be broken after that.

On the other hand the official version will bring a few bug fixes, improved channel initialization logic and the notification action will now accept channel names as keys for the input map which will make it easier to create custom notifications. Moreover finally there is proper documentation for the binding.

3 Likes

That’s very appreciated, even when I have to recreate the Thing(s).

To be honest, this has happened to many other bindings as well and it’s no big deal after all.
The marketplace bindings are (according to my understanding) more mutative, so when it comes to the shift to an official binding, it’s to be expected that there are at least some breaking changes.

1 Like