Skip to content

Commit

Permalink
Send light level in Lux instead of raw value
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelschreiner committed Apr 9, 2024
1 parent 0c280d1 commit d8be861
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The bridge is designed to parse the following events. (If you are missing an eve
| --- | --- |
| `BUTTON` | This event is triggered when a button on a Hue Dimmer Switch, Hue Button or an other similar device is pressed. The button_state is `1` as long the as the button is pressed and `0` when released. <br/><br/>Note that for BUTTON events, the `{item_state}` has a format of `{button_number}/{button_state}`. This is because a single hue accessory can have multiple buttons. <br/><br/> Example: `hue_event/sensors/29/1/1`|
| `MOTION` | This event is triggered when motion is detected by a Hue motion sensor. The state is `1` when motion is detected and `0` when no motion is detected. <br/><br/> Example: `hue_event/sensors/34/1`|
| `LIGHT_LEVEL` | This event is triggered when the light level changes on a Hue light sensor. The state represents the current light level. To get the actual brightness in Lux, use this formula: 2.718281828459^(value*0.00023034)-1 <br/><br/> Example: `hue_event/sensors/35/10597`|
| `LIGHT_LEVEL` | This event is triggered when the light level measured by a Hue motion sensor changes. The state represents the current light level in Lux. <br/><br/> Example: `hue_event/sensors/35/230` = 230 Lux |
| `TEMPERATURE` | This event is triggered when the temperature changes on a Hue motion sensor. The state represents the current temperature as a float value. <br/><br/> Example: `hue_event/sensors/36/25.36` = 25.36°C|
| `LIGHT` | This event is triggered when the state of a light changes. The state is `1` when the light is on and `0` when the light is off. <br/><br/> Example: `hue_event/lights/4/1`|
| `GROUPED_LIGHT` | This event is triggered when the state of a light group changes. The state is `1` when the group is on and `0` when the group is off. <br/><br/> Example: `hue_event/groups/3/0`|
Expand Down
2 changes: 1 addition & 1 deletion hue2lox.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def parse_event(event_type, item):
item_id = item.id_v1

elif item.type.name == "LIGHT_LEVEL":
item_state = item.light.light_level
item_state = int(10 ** (item.light.light_level / 10000)) - 1
item_id = item.id_v1

elif item.type.name == "TEMPERATURE":
Expand Down

0 comments on commit d8be861

Please sign in to comment.