Nora google, ikea tradfri lamp

Hi Guys

I have a Ikea tradfri lamp that i control with Nora and google for ON and OFF
When i want to control the brightness the problem starts

This is how the flow now looks like

[{"id":"ddfed62f.093d68","type":"nora-light","z":"1a9416eb.ba0129","devicename":"Lamp boekenkast","lightcolor":false,"brightnesscontrol":false,"turnonwhenbrightnesschanges":false,"passthru":true,"statepayload":true,"brightnessoverride":"","roomhint":"Slaapkamer","name":"","nora":"9d167d4b.443f","topic":"","onvalue":"ON","onvalueType":"str","offvalue":"OFF","offvalueType":"str","x":110,"y":40,"wires":[["baf3d643.307af8","1eac81c2.ab392e"]]},{"id":"1eac81c2.ab392e","type":"mqtt out","z":"1a9416eb.ba0129","name":"Boekenkast lamp","topic":"zigbee2mqtt/0xccccccfffe8ab8f4/set","qos":"0","retain":"false","broker":"c40e4a64.770398","x":450,"y":80,"wires":[]},{"id":"baf3d643.307af8","type":"debug","z":"1a9416eb.ba0129","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":430,"y":40,"wires":[]},{"id":"9d167d4b.443f","type":"nora-config","z":"","name":"nora config","group":"","notify":true},{"id":"c40e4a64.770398","type":"mqtt-broker","z":"","name":"Hassio main","broker":"192.168.2.23","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

And this is the payload comming out the nora google command when i changed the bridgeness

payload: object

online: true

on: true

brightness: 65

topic: ""

_msgid: "d90c187d.2cd088"

Then only brightness work but ON and OFF from the bulb not, can someone help me out please

Forgot the flow when activate the node for google light and brightness control

[{"id":"ddfed62f.093d68","type":"nora-light","z":"1a9416eb.ba0129","devicename":"Lamp boekenkast","lightcolor":false,"brightnesscontrol":true,"turnonwhenbrightnesschanges":true,"passthru":true,"statepayload":true,"brightnessoverride":"","roomhint":"Slaapkamer","name":"","nora":"9d167d4b.443f","topic":"","onvalue":"ON","onvalueType":"str","offvalue":"OFF","offvalueType":"str","x":110,"y":40,"wires":[["baf3d643.307af8","1eac81c2.ab392e"]]},{"id":"1eac81c2.ab392e","type":"mqtt out","z":"1a9416eb.ba0129","name":"Boekenkast lamp","topic":"zigbee2mqtt/0xccccccfffe8ab8f4/set","qos":"0","retain":"false","broker":"c40e4a64.770398","x":450,"y":80,"wires":[]},{"id":"baf3d643.307af8","type":"debug","z":"1a9416eb.ba0129","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":410,"y":40,"wires":[]},{"id":"9d167d4b.443f","type":"nora-config","z":"","name":"nora config","group":"","notify":true},{"id":"c40e4a64.770398","type":"mqtt-broker","z":"","name":"Hassio main","broker":"192.168.2.23","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

have you looked at the other threads about 'tradfri'?

they use the ikea hub, i use zigbee

this https://discourse.nodered.org/t/zigbee-the-best-node/3349/6or this https://phoscon.de/en/raspbee2 might help.

Other than that I'll have to bow out now having neither the lamp or zigbee

nope nothing there, they use not google (nora) and zigbee2mqtt with ikea tradfrik bulb that have on of and brithness control

Would there be any objection to moving this thread to the "Hardware" category, since @sniperxnl seems to be looking for advice specific to his particular hardware setup?

2 Likes

Look at the attached flow. I'm using brightness control with NORA and KNX devices. Should be easily adopted to Zigbee devices. I have Zigbee devices too. I'm using a Phoscon Conbee II USB Stick with Node node-red-contrib-deconz.flows.json (2.8 KB)

Deconz is not working with my usb stick.

Do you own this one? --> https://www.phoscon.de/de/conbee2

Cc2531 stick i am using

Not all zigbee controllers are compatible with Phoscon, and since Sniperxnl above mentions they're using zigbee2mqtt, we can just respect that choice and try to come up with a solution following that. It's a personal choice what kind of gateway setup to use. I went with Phoscon, and a Conbee II stick to match it up, others will use zigbee2mqtt.

You're publishing to zigbee2mqtt/0xccccccfffe8ab8f4/set. The zigbee2mqtt documentation describes that to publish to this topic, you always have to use an object as payload. https://www.zigbee2mqtt.io/information/mqtt_topics_and_message_structure.html#zigbee2mqttfriendly_nameset
Which you do. The formatting was lost when you pasted the object here, but (correct me if I'm wrong), it looks like this:

{
    payload: {
        online: true,
        on: true,
        brightness: 65
    },
    topic: ""
    _msgid: "d90c187d.2cd088"
}

Keep in mind that each device uses a specific payload format. An example is given on the MQTT FAQ for IKEA TrĂĄdfri bulbs (E27 fitting), but that might not be the one you've connected. Still, I'm expecting Ikea devices to be mostly compatible in how they're talking, so try to edit that example.

{
  "state": "ON",
  "brightness": 215,
  "color_temp": 325
}

Put a function node (or change node depending on which you're most comfortable with) between the Nora output, and the mqtt-out node. Your goal is to transform the payload object to that kind of format, so a key state with a value "ON"/"OFF", and a key brightness with the value.
I hope that helps.

Thanks for the good information @afelix, if i understand it correctly then it is possible to chnage the dimmer function with google assist and on or off?

Zigbee2mqtt works btw great with there motion sensors and e27 tradfri warm white bulb

I don't use Nora myself, and as I'm mid-moving I don't have a proper connection to my Node-RED install(s) at the moment, so I can't test any flows really. When you say "dimmer function", do you mean something in Nora, or the functionality of dimming lights in general.

Rather than look at the exact situation you see here, look at it more generic: Zigbee2mqtt allows you to query the state of devices, and to subscribe to state changes, as well as publish those changes yourself for the device to act on. Nora outputs information coming from google assist. You posted an output of that in your first post. Your goal now is to transform that information from google assistant, to a format that your device on zigbee2mqtt can read.

As you're already publishing to zigbee2mqtt/[friendly_name]/set, you don't have to add much. If you had been publishing to the specific topic for each aspect (zigbee2mqtt/[friendly_name]/set/state or zigbee2mqtt[friendly_name]/set/brightness), you would have just published a single item in a payload, for example msg.payload = "ON" for the state. With using zigbee2mqtt/[friendly_name]/set, you have to create a payload object that matches what your IKEA bulb on zigbee is expecting.

Take a look at this note from the Zigbee2mqtt FAQ:

Nora might add additional properties/attributes that your lamp does not support. Make sure they're no longer on the object that you send to the mqtt-out node.
An option for that is to use a change node, where you set the msg.payload with JSONata. Here's an example: https://try.jsonata.org/cmULsyI0

Knipsel

This Works, no control, but a set brightness

1 Like

Make sure you change your off payload to an object syntax too.

Try setting the 'dimmer' value instead of the 'brightness'. I've seen some tradfri libs that use this.

done, thanks

Nora, node don't have dimmer function only brightness, it works but only for brightness not on or off and only between 0-99, not 0-255 what ikea bulb needed