Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Unsolved
Collapse
Discussion Forum to share and further the development of home control and automation, independent of platforms.
  1. Home
  2. Software
  3. Multi-System Reactor
  4. JSON payload in MQTTController entities actions (+ reverse color mapping to RGB)
DynamicGroupController updating members issue
CrilleC
Bare-metal latest-26193 I have this group: "OKforLarm": name: OK för Larm select: - include_controller: vera - include_capability: door_sensor filter_expression: entity.attributes.door_sensor.state It contains the entities I expect but behaves a bit odd. When I open vera>device_10097 the entity attribute door_sensor.state changes to true but it won't show up as member in the group, when I also open vera>device_10095 they both shows as members and when I close vera>device_10095 it disappear from the group but when I close vera>device_10097 it lingers in the group until I restart Reactor.
Multi-System Reactor
DynamicGroupController and attributes
therealdbT
Hey @toggledbits I'm back to trying to optimize a couple of things based on dynamic group. First of all, I think I found a typo in the doc: primary_attribute: "binary_sensor.state" primary_attribute_value: | d = false; each id in members: d = getEntity(id)?.attributes?.power_switch?.state or d, d I think the correct code snippet is d = false, All that said, my use case for dynamic groups is to group 3 different climate devices, so I could easily command them at the same time. Commands are good, but sometimes I want to check if any of the devices are on, and that's easily done with a similar snippet as the one you have in the docs. But this is limited to the primary attribute, while I want to have any of the attributes in the group to be driven by a similar logic (while all are null in the group). ie, access hvac_control.mode and see if any of the unit is set to cool, or heat. Is that possible, without re-defining an expression in each of my rules? Thanks!
Multi-System Reactor
Arming Envisalink panel from MSR
T
Topic thumbnail image
Multi-System Reactor
Upgrade Issues
T
Topic thumbnail image
Multi-System Reactor
[SOLVED] Conflicting Set Reaction Groups Appear to Fire Simultaneously in Single Rule Evaluation
G
Topic thumbnail image
Multi-System Reactor
[SOLVED] Question regarding "in" vs "contains" vs contents of the string
G
Topic thumbnail image
Multi-System Reactor
Reactor (Multi-System/Multi-Hub) Announcements
toggledbitsT
Build 21228 has been released. Docker images available from DockerHub as usual, and bare-metal packages here. Home Assistant up to version 2021.8.6 supported; the online version of the manual will now state the current supported versions; Fix an error in OWMWeatherController that could cause it to stop updating; Unify the approach to entity filtering on all hub interface classes (controllers); this works for device entities only; it may be extended to other entities later; Improve error detail in messages for EzloController during auth phase; Add isRuleSet() and isRuleEnabled() functions to expressions extensions; Implement set action for lock and passage capabilities (makes them more easily scriptable in some cases); Fix a place in the UI where 24-hour time was not being displayed.
Multi-System Reactor
Logon screen timeout
G
Noticing since 170 that the lock screen doesn't switch to the logon prompt but, rather, stays on the active UI until such time as you go to click something within it. Then it jumps to the login screen. Brave browser Brave 1.92.139 (Official Build) (arm64) Chromium: 150.0.7871.114
Multi-System Reactor
[MSR] Copy&past of actions and/or drag&drop between set/reset
therealdbT
Hey @toggledbits One thing that bothers me while doing work on new systems/new features, is that I cannot copy&paste actions, and I cannot drag&drop between set and resets. #1 is for when I want to copy an action between different rules opened in two separate browser windows, while #2 is when I just need to flip a bunch of actions in the reset, or move some logic back and forth. Both will be appreciated, but I understand the technical challenges. Thanks!
Multi-System Reactor
Upgrade advice - upgrade from aarch64 to ARM64 image
T
I'm currently on version 26011. I understand that the aarch64 image is no longer supported. So, I therefore need to update to the ARM64 image. Can anyone possibly suggest how I update my docker compose.yaml file (see below). Ideally I'd like to keep my existing reactions etc. rather than start from scratch. # Multi-System Reactor template docker-compose.yml (version 22160) # # Change the lines indicated by "DO"... # services: reactor: container_name: reactor environment: # DO change the TZ: line to set your local time zone. # See valid TZ list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones TZ: GB # # DO NOT change this path. Your directory location is in "source" below. REACTOR_DATA_PREFIX: /var/reactor # DO change the image below to the one you are using (e.g. armv7l or aarch64 for RPi 4) image: toggledbits/reactor:latest-aarch64 restart: "always" expose: - 8111 ports: - 8111:8111 volumes: # DO change the /home/username/reactor below to the directory you created for # your local data; DO NOT change the /var/reactor part - /home/pi/docker/reactor:/var/reactor - /etc/localtime:/etc/localtime:ro tmpfs: /tmp
Multi-System Reactor
Alexa for MSR, any interest?
MikeReadingtonM
Topic thumbnail image
Multi-System Reactor
[RESOLVED] Telegram notification broke with latest update
3
Topic thumbnail image
Multi-System Reactor
[RESOLVED] Phantom device, “INFO” appears
wmarcolinW
Topic thumbnail image
Multi-System Reactor
[RESOLVED] Mode Status NULL
wmarcolinW
Topic thumbnail image
Multi-System Reactor
[RESOLVED] HTTP query failing after version 26177
wmarcolinW
Topic thumbnail image
Multi-System Reactor
Question about the find function
wmarcolinW
Topic thumbnail image
Multi-System Reactor
[Answered] OK to remove old json files?
3
Topic thumbnail image
Multi-System Reactor
Deprecation Announcement: 32-bit ARM *docker* images
toggledbitsT
If you are using the armv7l docker image, the OpenJS Foundation that publishes node is no longer producing 32-bit builds as of v24. That means the last supported LTS version of node for armv7l is v22, which will go End-of-Life in May 2027. Therefore, the Reactor armv7l image is now deprecated and will only be produced until node v22 goes EOL, and I will not publish armv7l images beyond that date. If you are running an RPi 3 or earlier with Reactor, you are on this image, and will need to upgrade hardware to a 64-bit model and use the arm64 image. If you need help getting it done, ask in this category.
Multi-System Reactor
[Solved] build 26150 - engine not starting
G
@toggledbits I pulled the image (well, Watchtower did) and within minutes the whole system went offline. The log looks like it ends with 26143. [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-mkahsmgf/26qq82mw-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-lqyfljfi/22f8on0t-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-lsb61rw8/24oenqi2-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-lrh58he0/rule-lrh58he0:S-1c00gfib-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-lrh58he0/1c00dylr-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-lrh58he0/1nam9w5u-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-miuh2qqi/22ls4lql-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-kwc6rmci/rule-kwc6rmci:S-1vj8sdfc-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-kwc6rmci/rule-kwc6rmci:S-1qanz01x-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-ladyja6a/24lq19p6-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-mk0o8iox/23oy468y-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-miscg2h3/rule-miscg2h3:S-22gmbq1c-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#re-kxgrfjke/238p0old-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#re-m7ccsso5/re-m7ccsso5-1r0myjxa-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-ladyja6a/19nl9wq2-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-ladyja6a/rule-ladyja6a:S-yl3xk9t-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-ladyja6a/rule-ladyja6a:S-yl3vv5m-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#re-ln7j2nqp/re-ln7j2nqp-22mx9lzd-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#re-ln7j2nqp/22mx87c8-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-licneppy/1mzwe7ht-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-ml3194ih/25jqt1j4-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#re-kxgrg7kf/227hshak-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-reactorexmachina/13ua1p95-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-reactorexmachina/13uagam7-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-grpvl9oypg/rule-grpvl9oypg:R-134x4cbv-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-grpvl9oypg/rule-grpvl9oypg:R-134x2fyl-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#re-lscjrws1/238p5c22-cons [latest-26143]2026-05-31T15:23:44.547Z <default:INFO> Closing container Container#Predicate#rule-lbwr0jvq/1xkczf03-cons [latest-26143]2026-05-31T15:23:44.547Z <Structure:NOTICE> Structure Structure#1 stopped [latest-26143]2026-05-31T15:23:44.547Z <app:NOTICE> Closing APIs... [latest-26143]2026-05-31T15:23:44.547Z <wsapi:NOTICE> wsapi: closing... [latest-26143]2026-05-31T15:23:44.547Z <wsapi:NOTICE> wsapi: disconnecting from "192.168.1.23#82" (1001 service closing) [latest-26143]2026-05-31T15:23:44.548Z <httpapi:NOTICE> HTTP API closing... [latest-26143]2026-05-31T15:23:44.549Z <wsapi:NOTICE> wsapi: server closed [latest-26143]2026-05-31T15:23:44.549Z <httpapi:INFO> HTTP server closed. [latest-26143]2026-05-31T15:23:44.549Z <app:NOTICE> Stopping timers... [latest-26143]2026-05-31T15:23:44.551Z <app:null> Shutdown complete, process ID 1 [latest-26143]2026-05-31T15:23:44.551Z <app:null> Closing logs... [latest-26143]2026-05-31T15:23:44.551Z <default:null> Closing log I can SSH to the VM. Alas, I do not have the previous image for 26143 as I'm a little too quick sometimes on housekeeping.
Multi-System Reactor
http request action & digest auth
tunnusT
I’m using the HTTP Request action in MSR and need to authenticate against an endpoint that uses HTTP Digest authentication. Now that endpoint was changed to use SHA-256 in digest auth, so I would like to know if MSR supports it, or is it limited to MD5-based digest auth?
Multi-System Reactor

JSON payload in MQTTController entities actions (+ reverse color mapping to RGB)

Scheduled Pinned Locked Moved Multi-System Reactor
9 Posts 4 Posters 2.5k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mgvra
    wrote on last edited by
    #1

    Some background
    I'm trying to integrate a Zigbee device into the MSR using zigbee2mqtt bridge and MQTTController. The device in question is a cheap mood light that has following properties that I'd like to control:

    • switch (on/off)
    • brightness
    • color

    I'v already managed to get the switch part working and can toggle the light on/off. Also the brightness value is mapped back to MSR. In zigbee2mqtt it has a value range from 0 to 254, so this the reason for the expression:

    expr: 'payload.brightness / 254'
    

    Here's the entity definition (don't know whether the type should be something else than the Switch)

    zigbee-lidl-mood-light:
      name: 'Lidl Mood Light'
      friendly_name: 'Mood Light'
      type: Switch
      uses_template: lidl-moodlight      
    

    And the corresponding template (NOTE: rgb_color has not been defined in this example):

    lidl-moodlight:
      init: "zigbee2mqtt/%friendly_name%/get/state"
      query: "zigbee2mqtt/%friendly_name%/get/state"
      capabilities:
        - power_switch
        - toggle
        - dimming
      primary_attribute: power_switch.state
      events:
        "zigbee2mqtt/%friendly_name%":
          "power_switch.state":
            json_payload: true
            expr: 'upper(payload.state) == "ON"'
          "dimming.level":
            json_payload: true
            expr: 'payload.brightness / 254'          
      actions:
        power_switch:
          "on":
            topic: "zigbee2mqtt/%friendly_name%/set/state"
            payload: 'ON'
          "off":
            topic: "zigbee2mqtt/%friendly_name%/set/state"
            payload: 'OFF'
          set:
            topic: "zigbee2mqtt/%friendly_name%/set/state"
            payload: 
              expr: "parameters.state ? 'ON' : 'OFF'"
              type: raw
          toggle:
            topic: "zigbee2mqtt/%friendly_name%/set/state"
            payload: 'TOGGLE'
    

    The problem
    In order to control the brightness or the RGB color values, I would have send a JSON payload in corresponding actions. But I have no idea how to define it in the template. The reason why the switch part is working is that the zigbee2mqtt accepts also plain ON / OFF / TOGGLE string payloads in that case.

    But the brightness should be controlled with the following payload:

    {"brightness": 196}
    

    And the RGB color like:

    {"color":{"rgb":"46,102,150"}}
    

    Here's the link for the documentation (the Exposes part defines the messages).

    So how should I define the JSON payload for example for the dimming action? It definitely should be some sort of expressions since I have to map the MSR real value (0...1) to (0...254) for the zigbee2mqtt.

    actions:
        dimming:
          set:
            topic: "zigbee2mqtt/%friendly_name%/set"
            payload: 
              expr: ?????
              type: json
    

    Another problem is the RGB value. I could use the rgb_color capability for the setting but the problem is that the zigbee2mqtt only reports the current color in hue/saturation or xy coordinates.

    Here's an example of published message after setting the color:

    Topic: zigbee2mqtt/Mood Light QoS: 0
    {
       "brightness":254,
       "color":{
          "hue":240,
          "saturation":100,
          "x":0.1355,
          "y":0.0399
       },
       "color_mode":"xy",
       "color_temp":574,
       "linkquality":96,
       "state":"ON"
    }
    

    I would have to map those values back to RGB, but is it even possible with existing constructs in MQTTController's templates?

    Help would be appreciated @toggledbits
    br,
    mgvra

    toggledbitsT 1 Reply Last reply
    0
    • M mgvra

      Some background
      I'm trying to integrate a Zigbee device into the MSR using zigbee2mqtt bridge and MQTTController. The device in question is a cheap mood light that has following properties that I'd like to control:

      • switch (on/off)
      • brightness
      • color

      I'v already managed to get the switch part working and can toggle the light on/off. Also the brightness value is mapped back to MSR. In zigbee2mqtt it has a value range from 0 to 254, so this the reason for the expression:

      expr: 'payload.brightness / 254'
      

      Here's the entity definition (don't know whether the type should be something else than the Switch)

      zigbee-lidl-mood-light:
        name: 'Lidl Mood Light'
        friendly_name: 'Mood Light'
        type: Switch
        uses_template: lidl-moodlight      
      

      And the corresponding template (NOTE: rgb_color has not been defined in this example):

      lidl-moodlight:
        init: "zigbee2mqtt/%friendly_name%/get/state"
        query: "zigbee2mqtt/%friendly_name%/get/state"
        capabilities:
          - power_switch
          - toggle
          - dimming
        primary_attribute: power_switch.state
        events:
          "zigbee2mqtt/%friendly_name%":
            "power_switch.state":
              json_payload: true
              expr: 'upper(payload.state) == "ON"'
            "dimming.level":
              json_payload: true
              expr: 'payload.brightness / 254'          
        actions:
          power_switch:
            "on":
              topic: "zigbee2mqtt/%friendly_name%/set/state"
              payload: 'ON'
            "off":
              topic: "zigbee2mqtt/%friendly_name%/set/state"
              payload: 'OFF'
            set:
              topic: "zigbee2mqtt/%friendly_name%/set/state"
              payload: 
                expr: "parameters.state ? 'ON' : 'OFF'"
                type: raw
            toggle:
              topic: "zigbee2mqtt/%friendly_name%/set/state"
              payload: 'TOGGLE'
      

      The problem
      In order to control the brightness or the RGB color values, I would have send a JSON payload in corresponding actions. But I have no idea how to define it in the template. The reason why the switch part is working is that the zigbee2mqtt accepts also plain ON / OFF / TOGGLE string payloads in that case.

      But the brightness should be controlled with the following payload:

      {"brightness": 196}
      

      And the RGB color like:

      {"color":{"rgb":"46,102,150"}}
      

      Here's the link for the documentation (the Exposes part defines the messages).

      So how should I define the JSON payload for example for the dimming action? It definitely should be some sort of expressions since I have to map the MSR real value (0...1) to (0...254) for the zigbee2mqtt.

      actions:
          dimming:
            set:
              topic: "zigbee2mqtt/%friendly_name%/set"
              payload: 
                expr: ?????
                type: json
      

      Another problem is the RGB value. I could use the rgb_color capability for the setting but the problem is that the zigbee2mqtt only reports the current color in hue/saturation or xy coordinates.

      Here's an example of published message after setting the color:

      Topic: zigbee2mqtt/Mood Light QoS: 0
      {
         "brightness":254,
         "color":{
            "hue":240,
            "saturation":100,
            "x":0.1355,
            "y":0.0399
         },
         "color_mode":"xy",
         "color_temp":574,
         "linkquality":96,
         "state":"ON"
      }
      

      I would have to map those values back to RGB, but is it even possible with existing constructs in MQTTController's templates?

      Help would be appreciated @toggledbits
      br,
      mgvra

      toggledbitsT Offline
      toggledbitsT Offline
      toggledbits
      wrote on last edited by
      #2

      @mgvra You're on the right track. For an action like dimming.set, where a JSON payload is to be sent, you set the json type as you've done, and then you just need to make sure that the payload value is an object.

      actions:
          dimming:
            set:
              topic: "zigbee2mqtt/%friendly_name%/set"
              payload: 
                type: json
                expr: >
                  { "brightness": parameters.level * 255 }
      

      That last line evaluates to an expression language object data type containing a single key brightness whose value is the result of the subexpression, which in this case is the parameter value level given to the action scaled up to the device's units (I guessed; do what works here).

      The important thing to realize here is that the expression is producing an object, not a string that looks like JSON. The type: json flag will cause MQTTController to convert the object to its JSON representation, whatever that requires.

      Don't forget you can set MQTTController's log level to 5 while doing this work to troubleshoot what you are doing and see more clearly what is ultimately being sent.

      I do have functions for converting between HS(L), RGB, and XY. Currently they are only available to HubitatController, but I can easily extend them to MQTTController as well. The trick there, however, is that your device's implementation is the same (e.g. for HSL 0° is red, 120° is green, 240° is blue, etc.). There's a de facto standard, but some devices have their own way.

      Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

      M 1 Reply Last reply
      0
      • toggledbitsT toggledbits

        @mgvra You're on the right track. For an action like dimming.set, where a JSON payload is to be sent, you set the json type as you've done, and then you just need to make sure that the payload value is an object.

        actions:
            dimming:
              set:
                topic: "zigbee2mqtt/%friendly_name%/set"
                payload: 
                  type: json
                  expr: >
                    { "brightness": parameters.level * 255 }
        

        That last line evaluates to an expression language object data type containing a single key brightness whose value is the result of the subexpression, which in this case is the parameter value level given to the action scaled up to the device's units (I guessed; do what works here).

        The important thing to realize here is that the expression is producing an object, not a string that looks like JSON. The type: json flag will cause MQTTController to convert the object to its JSON representation, whatever that requires.

        Don't forget you can set MQTTController's log level to 5 while doing this work to troubleshoot what you are doing and see more clearly what is ultimately being sent.

        I do have functions for converting between HS(L), RGB, and XY. Currently they are only available to HubitatController, but I can easily extend them to MQTTController as well. The trick there, however, is that your device's implementation is the same (e.g. for HSL 0° is red, 120° is green, 240° is blue, etc.). There's a de facto standard, but some devices have their own way.

        M Offline
        M Offline
        mgvra
        wrote on last edited by
        #3

        Thanks for yet another quick reply! I'll start playing with the expressions and JSON payloads now that I know the proper syntax.

                  expr: >
                    { "brightness": parameters.level * 255 }
        

        So it is this implicit parameters object that contains the value (level) to be set.
        In the case of step dimming, is this the notation?

                  expr: >
                    { "brightness": parameters.step * 255 }
        

        Don't forget you can set MQTTController's log level to 5 while doing this work to troubleshoot what you are doing and see more clearly what is ultimately being sent.

        Good point!

        I do have functions for converting between HS(L), RGB, and XY. Currently they are only available to HubitatController, but I can easily extend them to MQTTController as well. The trick there, however, is that your device's implementation is the same (e.g. for HSL 0° is red, 120° is green, 240° is blue, etc.). There's a de facto standard, but some devices have their own way.

        Well that would be really nice if it doesn't require too much effort. A new release of the MSR or just the MQTTController?

        The trick there, however, is that your device's implementation is the same (e.g. for HSL 0° is red, 120° is green, 240° is blue, etc.). There's a de facto standard, but some devices have their own way.

        Well I think those functions should exist even if they don't work with all possible devices. It's sure better than nothing and chances are that they work just fine.

        br,
        mgvra

        toggledbitsT 1 Reply Last reply
        0
        • M mgvra

          Thanks for yet another quick reply! I'll start playing with the expressions and JSON payloads now that I know the proper syntax.

                    expr: >
                      { "brightness": parameters.level * 255 }
          

          So it is this implicit parameters object that contains the value (level) to be set.
          In the case of step dimming, is this the notation?

                    expr: >
                      { "brightness": parameters.step * 255 }
          

          Don't forget you can set MQTTController's log level to 5 while doing this work to troubleshoot what you are doing and see more clearly what is ultimately being sent.

          Good point!

          I do have functions for converting between HS(L), RGB, and XY. Currently they are only available to HubitatController, but I can easily extend them to MQTTController as well. The trick there, however, is that your device's implementation is the same (e.g. for HSL 0° is red, 120° is green, 240° is blue, etc.). There's a de facto standard, but some devices have their own way.

          Well that would be really nice if it doesn't require too much effort. A new release of the MSR or just the MQTTController?

          The trick there, however, is that your device's implementation is the same (e.g. for HSL 0° is red, 120° is green, 240° is blue, etc.). There's a de facto standard, but some devices have their own way.

          Well I think those functions should exist even if they don't work with all possible devices. It's sure better than nothing and chances are that they work just fine.

          br,
          mgvra

          toggledbitsT Offline
          toggledbitsT Offline
          toggledbits
          wrote on last edited by toggledbits
          #4

          @mgvra said in JSON payload in MQTTController entities actions (+ reverse color mapping to RGB):

          So it is this implicit parameters object that contains the value (level) to be set.

          Yes, parameters will contain the values of any parameters the action requires/defines.

          @mgvra said in JSON payload in MQTTController entities actions (+ reverse color mapping to RGB):

          In the case of step dimming, is this the notation?
          expr: > { "brightness": parameters.step * 255 }

          Well, from the look of it, no. I think your device is going to set the brightness to whatever value is in step, not increment or decrement the brightness by that amount. If your device offers another topic to increment or decrement, you will need to use that instead.

          If your device doesn't have up/down brightness topics, you need to emulate them by using what we already know about the device. The entity has the current brightness level on it, so emulating step dimming is a matter of doing the math. Here's an example with fixed 10% up/down. The entity object is loaded with the action's subject entity, so we can access the current dimming level using its attribute:

          actions:
            dimming:
              up:
                topic: "zigbee2mqtt/%friendly_name%/set"
                payload: 
                  type: json
                  expr: >
                    { "brightness": min(1, entity.attributes.dimming.level + 0.1) * 255 }
              down:
                topic: "zigbee2mqtt/%friendly_name%/set"
                payload: 
                  type: json
                  expr: >
                    { "brightness": max(0, entity.attributes.dimming.level - 0.1) * 255 }
          

          Note that the dimming capability does not have any parameters for the up and down actions.

          Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

          1 Reply Last reply
          1
          • toggledbitsT Offline
            toggledbitsT Offline
            toggledbits
            wrote on last edited by
            #5

            MQTTController 23116 is now available for download; it has hsltorgb(hue,sat,lev) and rgbtohsl(r,g,b) functions available in expressions.

            Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

            tunnusT 1 Reply Last reply
            1
            • toggledbitsT toggledbits

              MQTTController 23116 is now available for download; it has hsltorgb(hue,sat,lev) and rgbtohsl(r,g,b) functions available in expressions.

              tunnusT Offline
              tunnusT Offline
              tunnus
              wrote on last edited by
              #6

              @toggledbits related to this topic, I'm trying to set color with exactly the same lamp using the following configuration (MSR build is latest-24152-3455578a, MQTT version is 24142):

              reactor.yaml

               "zigbee2mqtt_smartmood":
                        name: 'Smart Mood Light'
                        friendly_name: 'Lidl smart mood'
                        include: ["lidl_moodlight", "lidl_moodlight_rgb"]
              

              local_mqtt_devices.yaml
              ("lidl_moodlight" part is omitted as it's not relevant here)

              lidl_moodlight_rgb:
                  capabilities: ["rgb_color"]
                  actions:  
                    rgb_color:
                      set: false
                      set_rgb:
                        topic: "zigbee2mqtt/%friendly_name%/set"
                        payload:
                          type: json
                          expr: '{"color": {"r": parameters.red, "g": parameters.green, "b": parameters.blue} }'
              

              The problem is that MQTT message is sent with null values, example below.

              {
                "color": {
                  "r": null,
                  "g": null,
                  "b": null
                }
              }
              

              which is kinda expected, as MSR UI does not "ask" for these values when you select "rgb_color.set_rgb" action

              Screenshot 2024-06-10 at 16.25.24.png

              Any hints what could be changed in the configuration?

              Using MSR on Docker (Synology NAS), having InfluxDB, Grafana & Home Assistant, Zigbee2MQTT & ZWA-2

              1 Reply Last reply
              0
              • toggledbitsT Offline
                toggledbitsT Offline
                toggledbits
                wrote on last edited by
                #7

                OK. First of all, great post. That gave me all the information right out of the gate to replicate enough of your configuration to duplicate the problem.

                Found and fixed. Try MQTTController build 24162.

                Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

                tunnusT 1 Reply Last reply
                👍
                0
                • toggledbitsT toggledbits

                  OK. First of all, great post. That gave me all the information right out of the gate to replicate enough of your configuration to duplicate the problem.

                  Found and fixed. Try MQTTController build 24162.

                  tunnusT Offline
                  tunnusT Offline
                  tunnus
                  wrote on last edited by
                  #8

                  @toggledbits thanks! First it seemed that this fix isn't working, but worked as expected after I deleted the old entity...

                  Using MSR on Docker (Synology NAS), having InfluxDB, Grafana & Home Assistant, Zigbee2MQTT & ZWA-2

                  1 Reply Last reply
                  1
                  • CrilleC Offline
                    CrilleC Offline
                    Crille
                    wrote on last edited by Crille
                    #9

                    It's the same for dimming.set and power_switch.set all .set, an entity rebuild solves those too with 24162.

                    (@toggledbits Mantis ID 372)

                    1 Reply Last reply
                    0
                    • toggledbitsT toggledbits locked this topic on
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    Recent Topics

                    • DynamicGroupController updating members issue
                      toggledbitsT
                      toggledbits
                      0
                      4
                      14

                    • DynamicGroupController and attributes
                      therealdbT
                      therealdb
                      1
                      5
                      66

                    • Arming Envisalink panel from MSR
                      toggledbitsT
                      toggledbits
                      0
                      5
                      90

                    • Upgrade Issues
                      T
                      tbully
                      0
                      9
                      205

                    • [SOLVED] Conflicting Set Reaction Groups Appear to Fire Simultaneously in Single Rule Evaluation
                      toggledbitsT
                      toggledbits
                      0
                      10
                      213

                    • [SOLVED] Question regarding "in" vs "contains" vs contents of the string
                      G
                      gwp1
                      0
                      5
                      105

                    • Reactor (Multi-System/Multi-Hub) Announcements
                      toggledbitsT
                      toggledbits
                      5
                      147
                      128.4k

                    • openLuup console disappeared - 500 - Internal Server Error
                      A
                      a-lurker
                      0
                      2
                      158

                    • Logon screen timeout
                      G
                      gwp1
                      0
                      5
                      184

                    • [MSR] Copy&past of actions and/or drag&drop between set/reset
                      toggledbitsT
                      toggledbits
                      0
                      9
                      336

                    • Upgrade advice - upgrade from aarch64 to ARM64 image
                      toggledbitsT
                      toggledbits
                      0
                      4
                      198
                    Powered by NodeBB | Contributors
                    Hosted freely by 10RUPTiV - Solutions Technologiques | Contact us
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Unsolved