hyperion-project / hyperion.ng

The successor to Hyperion aka Hyperion Next Generation
https://hyperion-project.org/
MIT License
3.02k stars 375 forks source link

MQTT support - feature discussion #483

Open penfold42 opened 6 years ago

penfold42 commented 6 years ago

Would be a good thing. What functionality does it need ? Set static colour Set brightness Set on/off Start effect/clear effect

wolph commented 6 years ago

Most questions can probably be answered (and perhaps some code can be borrowed) from https://github.com/MrBramme/Mqtt-Hyperion-Remote

brindosch commented 6 years ago

We are talking about Hyperion as a MQTT Consumer (Subscriber) right? This is a first candidate for "hyperion python plugins". So this can be kept small as a python plugin that can be configured and interacts directly with Hyperion. Instead porting over to C++.

wolph commented 6 years ago

Yes, this would be a lot of work (and more error-prone) to implement in C++

penfold42 commented 6 years ago

Yes, but configuration via webUI would be good too in the same way the python effects have a UI json file

ebartz commented 4 years ago

This feature would be really awesome. I am trying to get Hyperion to work with my setup which involves different protocols. I thought about a feature for a webhook but then searched for MQTT as many of my devices and workflows use this to communicate.

Basically what it would need for configuration is a IP/Hostname, Port, MQTT Topic, Number of Leds

It could then just send RGB Values tot the configured MQTT Topic. As message you could just simply send a json object containing the RGB values.

Lord-Grey commented 4 years ago

@ebartz Sorry, would you mind clarifying... Are you talking about a) hyperion sends RGB values to an MQTT topic or b) hyperion receives RGB values from an MQTT topic and displays them on a hyperion connected LED-Device? Thank you!

ebartz commented 4 years ago

@Lord-Grey thanks for pointing me at this. My use-case would be option a. My lightning setup consists of some hue light controlled by deCONZ and a couple WS2812B stripes which are controlled by ESPhome. My whole setup is managed with home assistant. So what I need is a way to get the RGB values so that I can then use node red to actually control the individual lights.

But I also think, that option b is something that might be useful for others that want to control their hyperion setup and integrate it in their automations by simply using MQTT.

accelle17 commented 4 years ago

+1 on this on controlling the lights via MQTT. This is supported mostly by all opensource automation system, (HASS, OpenHab, Tasmota / ESPHome lights).

Dinth commented 4 years ago

+1 but im especially interested in Hyperion sending RGB values to MQTT so i can use HA automation to set colour on (unsupported by Hyperion) RGB lights.

m-seker commented 4 years ago

@ebartz Sorry, would you mind clarifying... Are you talking about a) hyperion sends RGB values to an MQTT topic or b) hyperion receives RGB values from an MQTT topic and displays them on a hyperion connected LED-Device? Thank you!

I'll implement case a

m-seker commented 4 years ago

Bad news, MQTT module of QT is under automation package https://doc.qt.io/QtMQTT/index.html

@Paulchen-Panther @tpmodding @Lord-Grey Other alternatives are https://github.com/eclipse/mosquitto and https://github.com/eclipse/paho.mqtt.c, both backed by Eclipse.

Mosquitto seems better maintained. Any preference ?

wolph commented 4 years ago

Mosquitto is the broker (server), not the client so that's not an option in any case

Just my two cents on the subject, Hyperion already supports several other protocols which are more suited for live color changes.

I'm not saying it's not possible with MQTT but I would recommend another protocol simply because MQTT goes through a server first which means you have double the delay.

@ebartz instead of ESPHome I would suggest using WLED which supports both Home Assistant and Hyperion without issues. And beyond that, it's a far nicer interface for controlling leds. I love ESPHome and I use it a lot, but it's not great for controlling leds.

wolph commented 4 years ago

As for controlling hyperion from home assistant, there's already a library for that: https://www.home-assistant.io/integrations/hyperion/

m-seker commented 4 years ago

There is a library called libmosquitto which provides client functionality https://mosquitto.org/api/files/mosquitto-h.html

wolph commented 4 years ago

I stand corrected :)

jes1417 commented 4 years ago

@WoLpH the library for HA is outdated and currently does not work with hyperion.ng.

m-seker commented 4 years ago

@WoLpH the library for HA is outdated and currently does not work with hyperion.ng.

I just tested and seems to work fine ?

jes1417 commented 4 years ago

For me the light toggle doesn't work in HA

https://github.com/home-assistant/core/issues/36471

jes1417 commented 4 years ago

Also

https://github.com/home-assistant/core/issues/35464

jclsn commented 2 years ago

Any news on this? I was hoping to be able to control my HA entities with hyperion

renne commented 1 year ago

What's the current state? I want to control a Shelly RGBW2 to adjust the room lighting (RGBW strip) to the current image average color and brightness.

Lord-Grey commented 1 year ago

What's the current state? I want to control a Shelly RGBW2 to adjust the room lighting (RGBW strip) to the current image average color and brightness.

MQTT is just a way of communication. To have Shelly via MQTT you need to first have the Shelly protocol supported, plus MQTT capabilities.

Currently, this is not a priority, but you are welcome to implement a Shelly device.

renne commented 1 year ago

@Lord-Grey Shelly devices already support MQTT. Hyperion just needs to register with the MQTT-broker and send JSON-messages to set color/brightnes values.

fredleger commented 1 year ago

The way i see it is that you get to mqtt controled lights for other reasons than ambilight like but want to integreate hyperion using the same protocol. Make perfect sense for my setup where i want to remove philips hue protocol.