mjwwit / node-red-contrib-ikea-tradfri

Node-RED nodes to get updates from and control devices connected to an IKEA TRADFRI gateway
3 stars 3 forks source link

Can you please give a example flow? #27

Closed superpower10 closed 1 year ago

superpower10 commented 2 years ago

I tried it with no luck to get the state.

The state node is connected to my central and shows the name of the devices but I can not bring it to deliver the state of these devices to a debug-window.

Heres how I tried it:

Bildschirmfoto 2022-02-18 um 08 34 09 Bildschirmfoto 2022-02-18 um 08 32 39

My problems seems to be the inject node. What do I have to write inside?

Bildschirmfoto 2022-02-18 um 08 35 46
mjwwit commented 2 years ago

There's 2 options here:

  1. You statically configure which devices you want to retrieve state for. You can do this in the tradfri-state configuration panel by selecting the devices (it's a multi-select box).
  2. You can put the accessory IDs of the devices you want state for in the message in the inject node. The easiest way to figure out the accessory IDs for your devices is to add a tradfri-monitor to your flow and send its output to a debug node. The IDs are number and can be put in the msg.topic. The msg.topic can either be a single number, or an array (list) of numbers. If you want to specify a list, first select the JSON data type and then enter the accessory IDs between [ and ] separated by commas (,). You should end up with something like this: [1234,4321].

Let me know if you got it to work.