Rate my hack - Meross Sensor clock ms130

Hi,

First post here. Happy to join the community.

I was playing around with automation to get around a limitation of the Meross Sensor clock ms130 integration - it has programmable buttons that aren’t exposed to Home Assistant as entities through the HACS. I can use the buttons to control other Meross devices and thought of a way to get the buttons integrated with Home Assistant.

The method I used is using the buttons to set a Meross light to a specific colour and then using Home Assistant automation to monitor the colour of the light.

We can get the state of the light to copy the RGB values. Using automation we can set a template to monitor the light for changes to set this colour

triggers:
  - trigger: template
    value_template: >-
      {{state_attr('light.smart_rgb_led_strip_2',
      'rgb_color') | list == [2, 0, 255]}}

The condition “| list” in the template was critical and had cost me 2 hours of debugging to figure out.

I use it to trigger a switchbot bot, to turn on a dumb AC unit and link triggering this event with the switchbot button state (AC is off, colour is [2, 0, 255], change button state)

Is it stupid? Yes. Does it work? Also yes!