Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Connect your philips hue lights to mqtt with this bridge. Inspired on https://github.com/mqtt-smarthome
This node.js application is a bridge between the Philips Hue and a mqtt server. Your lights will be polled every x seconds and the status(es) get published to your (local) mqtt server. As with a bridge it also works the other way around. You can turn on/off (and set the state) of your lights with a message to mqtt.
It's intended as a building block in heterogenous smart home environments where an MQTT message broker is used as the centralized message bus. See MQTT Smarthome on Github for a rationale and architectural overview.
Every message starts with a prefix (see config) that defaults to hue
. So if you change this all the topics change.
This bridge uses the hue/connected
topic to send retained connection messages. Use this topic to check your if your hue bridge is still running.
0
or missing is not connected (set by will functionality).1
is connected to mqtt, but not to the hue hardware.2
is connected to mqtt and hue hardware. (ultimate success!)The status of each thermostat will be published to hue/status/light/light_name
as a JSON object containing the following fields. The light_name is all lowercase and spaces are replaced with _
.
val
current brightness (or 0
if the light is off or unreachable).hue_state
JSON object retrieved from hue bridge.ts
timestamp of last update.Each status message is retained, so if you subscribe after a status message, you will always get the last status.
You can control each light by send one of the options below to hue/set/light/light_name
:
a single brightness value. (Number between 0 and 255, 0 for off)
a json object containing (some of) the following properties:
on
booleanbri
brightness (0-255)color
color input according to tinycolor2alert
select
(breath/blink once), lselect
(breath 30 sec), none
(back to normal)effect
colorloop
(rainbow mode), none
(back to normal)transitiontime
number (multiplied with 100 ms) to transition from the current state to the new state.Currently setting only the brightness does not work. This library uses hue-util for talking to the hue system. This library doesn't support setting the brightness (yet). I made an issue about it, if this issue gets fixed, it should automatically work here.
You would typically run this app in the background, but first you have to configure it. You should first install Node.JS.
git clone https://github.com/svrooij/hue2mqtt.git
cd hue2mqtt
npm install
nano config/local.json
You are now in the config file. Enter the following data as needed. See mqtt.connect for options how to format the host. mqtt://ip_address:1883
is the easiest.
{
"mqtt": {
"host":"mqtt://127.0.0.1:1883",
"user":null,
"password":null
}
}
The first time you run this application, it tries to connect to your hue system automatically, but that will only work if you press the button on your bridge. So do that before your start this appliation.
Try to start the application by running npm start
or directly by node bridge.js
, and the topics should appear on your mqtt server.
If everything works as expected, you should make the app run in the background automatically. Personally I use PM2 for this. And they have a great guide for this.
FAQs
Gateway between a Philips Hue bridge and MQTT
The npm package hue2mqtt receives a total of 1 weekly downloads. As such, hue2mqtt popularity was classified as not popular.
We found that hue2mqtt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.