Zigbee2Mqtt dimmer -> wifi bulb brightness

Hello,
I have a zigbee knob (Knob link) connected to my system with Zigbee2MQTT and I want to dim a WIFI light with it.

It's set up and I have a Zigbee2mqtt node in Node-Red with a debug node
and when i turn the knob, i can see the data in the debug and within the data (msg.payload: Object) i see the brightness

but, I cannot figure out how to make the actual (wifi) light brightness change to that number from the msg.payload object
action node: Home Assistant Entity (see below)

gives this error:

I have some programming experience from the 1990's but i'm no Javascript wizard, however some of the things I've tried keeps sounding like this msg.payload is an "object" and these nodes don't seem to like that

i've tried json node and changed node

I've found people controlling zigbee lights with zigbee controllers with MQTT via both sides, but my light is wifi and isn't controlled via MQTT that i'm aware, just as an Home Assistant Entity

Any hints to what I need to take this msg.payload (data?) and have my light react to the brightness (value?) in the payload?

show us what the debug from the knob looks like. I'm guessing it will be payload.something rather than just payload

You're missing a } at the end.

{"brightness_pct": {{payload}} }

show us what the debug from the knob looks like. I'm guessing it will be payload.something rather than just payload

Hello, here is the Debug

I have the following:

with this

and this

maybe this msg.payload.brightness is what you mean by "payload.something rather than just payload"?

Thanks, corrected that

it has to be

{"brightness_pct": {{payload.brightness}} }

ok so that syntax worked..

..but also, a new problem arrose

the expose value is 0 - 255 in Zigbee2MQTT

the "home assistant" "action" node brightness_pct is 0-100

so.. i'll need to either find another route, or maybe use a formula to translate 0-255 to 0-100

yes you need a function node to calculate

msg.payload.brightness=msg.payload.brightness/255*100

Or use the brightness key instead of brightness_pct

{"brightness": {{payload.brightness}} }

Or use the brightness key instead of brightness_pct

{"brightness": {{payload.brightness}} }

oh wow. that was it. Totally worked

thanks so much gents for your help