# Philips Hue Button

**URL:** <https://discourse.nodered.org/t/philips-hue-button/75085>\
**Category:** General\
**Created:** [12 February 2023 18:34 UTC](https://discourse.nodered.org/t/philips-hue-button/75085 "2023-02-12T18:34:46Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![ChrisF](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@ChrisF](https://discourse.nodered.org/u/ChrisF)\
**Post date:** [13 February 2023 17:20 UTC](https://discourse.nodered.org/t/philips-hue-button/75085/21 "2023-02-13T17:20:05Z")

</div>

I get the same values:

```auto
13.2.2023, 18:18:20node: debug 45
zigbee2mqtt/Hue Button Eingang : msg : Object
object
topic: "zigbee2mqtt/Hue Button Eingang"
payload: object
action: "press"
battery: 100
linkquality: 184
update: object
state: "idle"
update_available: false
qos: 0
retain: false
_msgid: "6ac4cceac0599eb0"
13.2.2023, 18:18:20node: debug 45
zigbee2mqtt/bridge/logging : msg : Object
object
topic: "zigbee2mqtt/bridge/logging"
payload: object
level: "info"
message: "MQTT publish: topic 'zigbee2mqtt/Hue Button Eingang', payload '{"action":"brightness_step_down","action_step_size":30,"action_transition_time":0.09,"battery":100,"linkquality":188,"update":{"state":"idle"},"update_available":false}'"
qos: 0
retain: false
_msgid: "916b27516f9aa062"
13.2.2023, 18:18:20node: debug 45
zigbee2mqtt/Hue Button Eingang : msg : Object
object
topic: "zigbee2mqtt/Hue Button Eingang"
payload: object
action: "brightness_step_down"
action_step_size: 30
action_transition_time: 0.09
battery: 100
linkquality: 188
update: object
update_available: false
qos: 0
retain: false
_msgid: "c44780ace3f30fd6"

```

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [13 February 2023 17:24 UTC](https://discourse.nodered.org/t/philips-hue-button/75085/22 "2023-02-13T17:24:54Z")

</div>

I don't know what to tell you, are you sure it is a philips device and not some other fake device ?  
What does zigbee2mqtt tell you in the interface about this device (the "exposes" tab)

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [14 February 2023 13:37 UTC](https://discourse.nodered.org/t/philips-hue-button/75085/23 "2023-02-14T13:37:59Z")

</div>

fyi, I tried to use the node-red-zigbee nodes when I started with zigbee. That was not successful.  
I completely skip it. I am now using the standard node-red mqtt nodes and that works.  
As far as I can remember, there were other forum users with the same problem.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [14 February 2023 14:17 UTC](https://discourse.nodered.org/t/philips-hue-button/75085/24 "2023-02-14T14:17:21Z")

</div>

The main issue is that OP's device is not reporting according to what should be reported.  
If you look at the [source of the device converter](https://github.com/Koenkk/zigbee-herdsman-converters/blob/5785a06ee2f71dee473fa1240c89f6909892af66/devices/philips.js#L1857), it does not expose the properties he is receiving from mqtt.

> ` exposes: [e.battery(), e.action(['on', 'off', 'skip_backward', 'skip_forward', 'press', 'hold', 'release'])],`

He receives:`brightness_step_down`

---

<div class="post-metadata">

**Author:** ![ChrisF](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@ChrisF](https://discourse.nodered.org/u/ChrisF)\
**Post date:** [15 February 2023 13:09 UTC](https://discourse.nodered.org/t/philips-hue-button/75085/25 "2023-02-15T13:09:30Z")

</div>

I have now done it this way:  
The device sends, as said, 7x step up and then 7x step down.  
At the first step up or down it sends `action_step_size: 30` and then always `56`. = step size: 366. that means 0 = 0% and 366 = 100%  
after that i used a range node with the input range 0-366 and output range 0-100.  
With this it worked.

I would now use a switch node, so that if brightness is higher than 1 the switch jumps to on.

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [18 February 2023 14:03 UTC](https://discourse.nodered.org/t/philips-hue-button/75085/26 "2023-02-18T14:03:56Z")

</div>

if you want to dimm up and down with button pressed and released than you might give the attached node a try.....  
You should fine tune the intervall and step size to your requirements

```auto
[{"id":"48c5808aaf8c39bc","type":"function","z":"f5502e1a8b0461f9","name":"LED Dimmer","func":"let delta = 13;\nlet brightness\n\nif(msg.payload === \"on\"){\n brightness = context.get('brightness');\n context.set('myInterval', setInterval(myDimmer, 500));\n node.warn(\"on\");\n return null;\n}\nelse if (msg.payload === \"off\"){\n clearInterval(context.get('myInterval'));\n context.set('brightness',brightness);\n return null; \n}\nelse if (msg.payload === \"reset\") {\n clearInterval(context.get('myInterval'));\n brightness = 0;\n context.set('brightness', brightness);\n node.send({ payload: { \"brightness\": brightness }});\n return null;\n}\n\n//--------------------------------------------------------------------\n\nfunction myDimmer() {\n node.warn(brightness);\n node.send({ payload: { \"brightness\": brightness}});\n brightness += delta;\n if (brightness === 364) {\n delta = -13;\n }\n if (brightness === 0) {\n delta = 13;\n }\n}\n\n//--------------------------------------------------------------------","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\n \ncontext.set('brightness',0);\n","finalize":"","libs":[],"x":370,"y":640,"wires":[["a7df9deb1460b059"]]},{"id":"f7dd55a08c6ae087","type":"inject","z":"f5502e1a8b0461f9","name":"press","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":170,"y":600,"wires":[["48c5808aaf8c39bc"]]},{"id":"49b6c29373b19858","type":"inject","z":"f5502e1a8b0461f9","name":"release","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":170,"y":640,"wires":[["48c5808aaf8c39bc"]]},{"id":"b484c0d9eb75194c","type":"inject","z":"f5502e1a8b0461f9","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"reset","payloadType":"str","x":170,"y":680,"wires":[["48c5808aaf8c39bc"]]},{"id":"a7df9deb1460b059","type":"debug","z":"f5502e1a8b0461f9","name":"debug 66","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":640,"wires":[]}]

```

[Previous page](https://discourse.nodered.org/t/philips-hue-button/75085.md?page=1)
