Awtrix (clock) notification [Custom Component]

just what i am lazy.

sorry, i’ll fix it. I’ll find time to add descriptions for services.

sorry again!

WBR, O

1 Like

Service description fixed.

A simple sample how to use service in blueprint.

blueprint:
  name: AWTRIX playing now
  description: Show the current playing track
  domain: automation
  input:
    media_player:
      name: Media player
      description: Media player what you want to control.
      selector:
        entity:
          filter:
            - domain: media_player
          multiple: false

    awtrix_device:
      name: AWTRIX device
      description: The AWTRIX device for show playing status.
      selector:
        device:
          integration: mqtt
          manufacturer: Blueforcer
          model: AWTRIX Light
          multiple: false

trigger:
  - platform: state
    entity_id: !input media_player

  - platform: time_pattern
    seconds: '/10'

variables:
  awtrix: !input awtrix_device
  awtrix_device_name: "{{ iif( device_attr(awtrix, 'name_by_user') != none, device_attr(awtrix, 'name_by_user'), device_attr(awtrix, 'name') ) }}"
  media_player_device: !input media_player

action:
  - variables:
      playing_state: "{{ states(media_player_device) }}"
      title_template: "{{ state_attr(media_player_device, 'media_title') }}"
      album_template: "{{ state_attr(media_player_device, 'media_album_name') }}"
      artist_template: "{{ state_attr(media_player_device, 'media_artist') }}"
      playing_percent: "{{ (100 - ((state_attr(media_player_device, 'media_duration') | default(0, true) - (state_attr(media_player_device, 'media_position') | default(0, true) + as_timestamp(now()) - as_timestamp(state_attr(media_player_device, 'media_position_updated_at') | default(now(), true)))) / 60) * 100 / (state_attr(media_player_device, 'media_duration') | default(1, true)  / 60)) | int }}"

  - if:
      - condition: template
        value_template: "{{ playing_state != \"playing\"  }}"
    then:
      - service: awtrix.{{awtrix_device_name}}_push_app_data
        data:
          name: sonos
          data: {}
    else:
      - service: awtrix.{{awtrix_device_name}}_push_app_data
        data:
          name: sonos
          data:
            rainbow: false
            repeat: 2
            pushIcon: 0
            textCase: 0
            progress: "{{playing_percent}}"
            progressC: "18B04C"
            text: >-
              {{ playing_state~': '~(artist_template ~ ' - ' if artist_template else '') ~ (title_template if title_template else '-') ~ (' ÷ ' ~ album_template ~ ' ÷ ' if album_template else '') }}
            icon: >-
              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/90ABAAB/9oADAMBAAIRAxEAPwD8R/2bvjdd/sOeKvhP+zJqHjTwH8P9Obw7b+NfHviPT7aPVtQ1VPtF/fQ6O93AsscjyafLAISAHAbNrNKHhjn/AF+/4fO/8E1f+ikf+UfVf/kOv42v2vf+Sr6T/wBiT4H/APUc02vl6v5qxnA+Azmnh82xLcataCnO0KTvKUpNu86c5dbJc1lFJLY/Z8NxPi8tnWwFFXp05csbyqKyikkrRnFeb01bbe5//9k=
            lifetime: 900

awtrix (4)

1 Like

experimental! :slight_smile:
weather app

service: awtrix.awtrix_bedroom_weather_app
data:
  weather: weather.forecast_home
  outside_temperature: sensor.easyweatherv1_6_4_outdoor_temperature
  home_temperature: sensor.home_temperature
  sun: sun.sun
  moon: sensor.moon_phase

weather - entity with weather forecast
outside_temperature (optional) - outside temperature sensor
home_temperature (optional) - home temperature sensor
sun (optional) - sun entity
moon (optional) - moon entity

awtrix (8)

please upload icons:

icon_clear_night_icon = 'a12181'
icon_cloudy_icon = 'a2283'
icon_exceptional_icon = 'a2364'
icon_fog_icon = '17056'
icon_hail_icon = 'a2441'
icon_lightning_icon = 'a630'
icon_lightning_rainy_icon = 'a49299'
icon_partlycloudy_icon = 'a2286'
icon_pouring_icon = 'a49300'
icon_rainy_icon = 'a2284'
icon_snowy_icon = 'a2289'
icon_snowy_rainy_icon = 'a49301'
icon_sunny_icon = 'a2282'
icon_windy_icon = 'a15618'
icon_windy_variant_icon = 'a15618'

full_moon_icon = '2314'
waning_gibbous_icon = '2315'
last_quarter_icon = '2316'
waning_crescent_icon = '2317'
new_moon_icon = '2318'
waxing_crescent_icon = '2319'
first_quarter_icon = '2320'
waxing_gibbous_icon = '36234'

sunrise_icon = '485'
sunset_icon = '486'

home_icon = "96"

Icons are not customized at this moment. Sorry!

2 Likes

OK able to customize =)
and no icons required by default

service: awtrix.awtrix_bedroom_weather_app
data:
  weather: weather.forecast_home
  home_temperature: sensor.home_temperature
  sun: sun.sun
  moon: sensor.moon_phase
  icons:
      clear-night: "a12181" 
      cloudy: "a2283"
      exceptional: "a2364"
      fog: "17056"
      hail: "a2441" 
      lightning: "a630" 
      lightning-rainy: "a49299" 
      partlycloudy: "a2286" 
      pouring: "a49300" 
      rainy: "a2284" 
      snowy: "a2289" 
      snowy-rainy: "a49301" 
      sunny: "a2282" 
      windy: "a15618" 
      windy-variant: "a15618" 
      full_moon: "2314" 
      waning_gibbous: "2315" 
      last_quarter: "2316" 
      waning_crescent: "2317" 
      new_moon: "2318"
      waxing_crescent: "2320" 
      first_quarter: "2320" 
      waxing_gibbous: "36234" 
      home:  "96"
      sunrise: "485" 
      sunset: "486" 
      unavailable:  "52176"
1 Like

is there an easy way to create a service that publishes the state of a sensor, e.g. the state of charge for a battery that is charging?
In the examples I only see (constant) texts published

no. it’s just service for sending notification and building abstract user apps.

I´m a little confused - how can i add it with HACS?

Sorry, never used HACS. I think you can ask in HACS community.

Same as for everything in HACS:

  1. Search for it
  2. Download it
  3. Restart HA
  4. Configure it

i´m very sorry im very new on homeassitant … moving my smarthome from openhab to ha in these days… Thy solved the problem… Thx for your kick in the richt destination . but i have an other understanding problem… what i have exact to enter in the configuration.yaml only
awtrix:

and the rest where i´ve to put that? in a yaml in a subfolder integrations? or under awtrix:
at the configuration.yaml ?

these is my try at configuration.yaml… but something do not work:

awtrix:
  service: awtrix.push_app_data
  data: 
    device: smartpixel
    name: test
    data:  # Nested data section for app data
      text: "Hello, AWTRIX Light!"
      rainbow: true
      icon: "87"
      duration: 5
      pushIcon: 2
      lifetime: 900
      repeat: 10

no. this NOT for configuration yaml.
this call service code.

1 Like

the custom components located
at /config/custom_components
just create folder awtrix and put content and restart HASS
or

but before please add integration: Download | HACS

1 Like

Integration is allready installed… Thanks a lot for these tipps! Your nice Weather app is running :slight_smile:

1 Like

does this work with Awtrix 3 ?

yep! it’s works

Really nice custom_component, thank you very much. Two questions, is it possible to set a duration for the screens in you Weather app? (Duration tag in data in the yaml did not work)
And second one, tested yesterday, the weather_sun screen worked fine, today it does not come up anymore. The entity in the yaml is sun.sun (and its the same automation that worked yesterday), but in mqtt in can only see an empty string:

image

Duration tag in data in the yaml did not work

ok, i’ll add duration and repeat parameters in next release

today it does not come up anymore.

it’s works =) just you miss =)
sorry, it’s a bug.
wrong time for showing - in UTC :face_with_diagonal_mouth:
i’ll also will fix it

Thank you!

btw. sunrise/sunset events threshold - 30 min…

Thanks for the fast answer. I just took a look in the source code, seems sunset or rise is only displayed 30 minutes before. I did a try and changed from 30 to 180 minutes, and voila:

image

Maybe this would even be nice to be customized by self. But even as it is now, it’s really good, thanks a lot!

You were one minute faster :wink: