[689] Hyperion integration
Moderators: leecollings, remb0
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
[689] Hyperion integration
Hello,
Just set up an Hyperion solution.
Hyperion is a DIY Ambilight for TV/movie etc etc.
This well documented : https://github.com/tvdzwan/hyperion/wiki and really stable
It's works as a web server.
Using it with XBMC is a real pleasure, and adding a video grabber you can appli Hyperion to your ISPTVbox or DVB reciever (if not inclued on your TV).
Hyperion can be use as "light" with Android/ios/webapp, and got some cool effect, of course we can use script to drive it for "effects", but not really user friendly for RGB color.
As this solution, is stable, well documented, can give a real WAF to our home automation, this can be really cool if it can be Drive by Domoticz :
Somes exemples :
- When Movie/tv show is end, turn TV and all accessorie OFF
- When it's lover time, set hyperion on a charming candel mode (using a 433 Remote or NFC Tag, or any thing you can use to define this).
- When is party (defin by a google calendar event) set Hyperion on disco mode
Just set up an Hyperion solution.
Hyperion is a DIY Ambilight for TV/movie etc etc.
This well documented : https://github.com/tvdzwan/hyperion/wiki and really stable
It's works as a web server.
Using it with XBMC is a real pleasure, and adding a video grabber you can appli Hyperion to your ISPTVbox or DVB reciever (if not inclued on your TV).
Hyperion can be use as "light" with Android/ios/webapp, and got some cool effect, of course we can use script to drive it for "effects", but not really user friendly for RGB color.
As this solution, is stable, well documented, can give a real WAF to our home automation, this can be really cool if it can be Drive by Domoticz :
Somes exemples :
- When Movie/tv show is end, turn TV and all accessorie OFF
- When it's lover time, set hyperion on a charming candel mode (using a 433 Remote or NFC Tag, or any thing you can use to define this).
- When is party (defin by a google calendar event) set Hyperion on disco mode
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
- iMars
- Posts: 8
- Joined: Tuesday 17 November 2015 21:51
- Target OS: Linux
- Domoticz version: Latest
- Contact:
Re: [689] Hyperion integration
With the following commands you can change the effect/color:
Edit: wrong button, submit instead of preview
With "runcommand" in a LUA script you can execute a command:
Create a device this way: http://blog.quindorian.org/2015/01/esp8 ... -of-x.html
And use the following script (not the one on the page mentioned above):
This create a dimmer which can fade only one color (I've got 4 dimmers for my Hyperion).
Note: Domoticz has priority 10, XBMC/Kodi has priority 1. When movie is playing, i've got ambilight, when movie stops, it goes back to the color set with domoticz
Code: Select all
echo '{ "command": "effect", "effect": {"name": "Full color mood blobs"}, "priority": 100 }' | nc x.x.x.x 19444
echo '{ "command": "clear", "priority": 100 }' | nc x.x.x.x 19444
echo '{ "command": "color", "color": [255,255,255], "priority": 100 }' | nc x.x.x.x 19444
With "runcommand" in a LUA script you can execute a command:
Code: Select all
runcommand = "echo '{ "command": "color", "color": [255,255,255], "priority": 100 }' | nc x.x.x.x 19444"
Where x.x.x.x is ofcourse the IP of hyperion
And use the following script (not the one on the page mentioned above):
Code: Select all
pi@domoticz:~$ cat domoticz/scripts/lua/script_device_MoodLight.lua
commandArray = {}
DomDevice = 'MoodLight' --name device
IP = 'x.x.x.x' -- ip address hyperion
Port = '19444'
-- default color (one color, dimmable)
DomR = 255 --RED
DomG = 31 --GREEN
DomB = 0 --BLUE
if devicechanged[DomDevice] then
if(devicechanged[DomDevice]=='Off') then
DomValue = 0;
print('Turn '..DomDevice..' off...')
elseif(devicechanged[DomDevice]=='On') then
DomValue = 31;
print('Turn '..DomDevice..' on...')
else
DomValue = (otherdevices_svalues[DomDevice]);
end
print('DomValue for '..DomDevice..' changed to:'..DomValue)
DomR = math.ceil(DomValue / 31 * DomR)
DomG = math.ceil(DomValue / 31 * DomG)
DomB = math.ceil(DomValue / 31 * DomB)
runcommand = "echo '{ \"color\": [" .. DomR .. "," .. DomG .. "," .. DomB .. "], \"command\": \"color\", \"priority\": 10 }' | nc " .. (IP) .. " " .. (Port) .. " ";
print (runcommand);
os.execute(runcommand);
end
return commandArray
pi@domoticz:~$
Note: Domoticz has priority 10, XBMC/Kodi has priority 1. When movie is playing, i've got ambilight, when movie stops, it goes back to the color set with domoticz
- iMars
- Posts: 8
- Joined: Tuesday 17 November 2015 21:51
- Target OS: Linux
- Domoticz version: Latest
- Contact:
Re: [689] Hyperion integration
Ofcourse a full integration would be even better! Or a dummy rgb dimmer, which can pass the corrosponding hex code to a LUA script, that combining my script would make it possible to have ONE switch for all kinds of colors
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
Thanks for your help !iMars wrote:Ofcourse a full integration would be even better! Or a dummy rgb dimmer, which can pass the corrosponding hex code to a LUA script, that combining my script would make it possible to have ONE switch for all kinds of colors
I really love this idea, and a rolling menu to choose which effect we want when "planning" a scene.
Very Nice Blog !!
I plan to do some looks like of your Ikea Hack but with a DIY Philips Hue Bridge (who act as a bulb too : https://github.com/sticilface/Esp8266-Hue) + ws2812b + Wemos Mini D1 : bridge part is ok, and well reconnize by domoticz, waiting my ws2812b strip.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
First feedback : perfect !
Just one issue :
- i use v4l2 grabber, not kodi ones.
when turn "virtual dimmer" off that doesn't enable v4l2, my led strip stay off until i restart hyperion.
Any idea ?
Just one issue :
- i use v4l2 grabber, not kodi ones.
when turn "virtual dimmer" off that doesn't enable v4l2, my led strip stay off until i restart hyperion.
Any idea ?
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
Got a solution : sending clearall when dimmer is off, freeing v4l2 led strip.
Now have to know how set this on lua script
Now have to know how set this on lua script
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
- iMars
- Posts: 8
- Joined: Tuesday 17 November 2015 21:51
- Target OS: Linux
- Domoticz version: Latest
- Contact:
Re: [689] Hyperion integration
Use my script, and instead of color 0,0,0 > use echo '{ "command": "clear", "priority": 100 }' | nc x.x.x.x 19444deennoo wrote:Got a solution : sending clearall when dimmer is off, freeing v4l2 led strip.
Now have to know how set this on lua script
Code: Select all
commandArray = {}
DomDevice = 'MoodLight' --name device
IP = 'x.x.x.x' -- ip address hyperion
Port = '19444'
-- default color (one color, dimmable)
DomR = 255 --RED
DomG = 31 --GREEN
DomB = 0 --BLUE
if devicechanged[DomDevice] then
if(devicechanged[DomDevice]=='Off') then
--DomValue = 0;
print('Turn '..DomDevice..' off...')
runcommand = "echo '{ \"command\": \"clear\", \"priority\": 10 }' | nc " .. (IP) .. " " .. (Port) .. " ";
print (runcommand);
os.execute(run command);
return commandArray;
elseif(devicechanged[DomDevice]=='On') then
DomValue = 31;
print('Turn '..DomDevice..' on...')
else
DomValue = (otherdevices_svalues[DomDevice]);
end
print('DomValue for '..DomDevice..' changed to:'..DomValue)
DomR = math.ceil(DomValue / 31 * DomR)
DomG = math.ceil(DomValue / 31 * DomG)
DomB = math.ceil(DomValue / 31 * DomB)
runcommand = "echo '{ \"color\": [" .. DomR .. "," .. DomG .. "," .. DomB .. "], \"command\": \"color\", \"priority\": 10 }' | nc " .. (IP) .. " " .. (Port) .. " ";
print (runcommand);
os.execute(runcommand);
end
return commandArray
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
will try it ! thanks !
Good blog by the way !
Good blog by the way !
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
It perfectly Works !
Thanks for your help !!
Thanks for your help !!
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
Next step ?
Get a "color picker"
Set One Dummy dimmer for each color who write on variable is value.
Set One Dummy dimmer for "lighting level" (Value variable for Hyperion remote / Level Variable for domoticz dimmer)
When Moving one of the dummy color slider it send to hyperion Red Dimmer + Blue Dimmer + Green Dimmer value to flollow :
Where DomR is value set last time you move slider
Where DomG is value set last time you move slider
Where DomB is value set last time you move slider
Get a "color picker"
Set One Dummy dimmer for each color who write on variable is value.
Set One Dummy dimmer for "lighting level" (Value variable for Hyperion remote / Level Variable for domoticz dimmer)
When Moving one of the dummy color slider it send to hyperion Red Dimmer + Blue Dimmer + Green Dimmer value to flollow :
Code: Select all
runcommand = "echo '{ \"color\": [" .. DomR .. "," .. DomG .. "," .. DomB .. "], \"command\": \"color\", \"priority\": 10 }' | nc " .. (IP) .. " " .. (Port) .. " ";
Where DomG is value set last time you move slider
Where DomB is value set last time you move slider
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
- iMars
- Posts: 8
- Joined: Tuesday 17 November 2015 21:51
- Target OS: Linux
- Domoticz version: Latest
- Contact:
Re: [689] Hyperion integration
I don't want to use this option, I've tried it, and its not handy. Only 31 red's, 31, blue's and 31 green's. Stil, you should be able to create 32.768 different colors, yet not do-able. I've created 4 sliders for the most used colors: light yellow for normal light, yellow, orange and red. All 4 with sliders like my first posted script.deennoo wrote:Next step ?
Get a "color picker"
Set One Dummy dimmer for each color who write on variable is value.
Set One Dummy dimmer for "lighting level" (Value variable for Hyperion remote / Level Variable for domoticz dimmer)
When Moving one of the dummy color slider it send to hyperion Red Dimmer + Blue Dimmer + Green Dimmer value to flollow :
Where DomR is value set last time you move sliderCode: Select all
runcommand = "echo '{ \"color\": [" .. DomR .. "," .. DomG .. "," .. DomB .. "], \"command\": \"color\", \"priority\": 10 }' | nc " .. (IP) .. " " .. (Port) .. " ";
Where DomG is value set last time you move slider
Where DomB is value set last time you move slider
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
OK !
Thanks for your feedback
Next step again ?
Made my hyperion follow my Milight color value...
Looks crazy that we are only 2 using hyperion & domoticz
Thanks for your feedback
Next step again ?
Made my hyperion follow my Milight color value...
Looks crazy that we are only 2 using hyperion & domoticz
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 3
- Joined: Friday 13 February 2015 17:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [689] Hyperion integration
I/m also using the solution from hyperion and was looking for a similair olution you are working on
+++++++++++++++++++++++++++++
Raspberry Pi B+
RFXCOMe
Kaku switches
x10 Security System
My system also act as XBMC
Raspberry Pi B+
RFXCOMe
Kaku switches
x10 Security System
My system also act as XBMC
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
Got a New probleme,
For fun i want some switch to load and stop effect :
Base on iMars elements i made this script, no lua error but no reaction from hyperion :
Any Idea please ?
For fun i want some switch to load and stop effect :
Base on iMars elements i made this script, no lua error but no reaction from hyperion :
Code: Select all
commandArray = {}
DomDevice = 'Hyperion Arc en Ciel' --name device
IP = '192.168.0.245' -- ip address hyperion
Port = '19444'
if devicechanged[DomDevice] then
if(devicechanged[DomDevice]=='Off') then
print('Turn '..DomDevice..' off...')
runcommand = "echo '{ \"command\": \"clear\", \"priority\": 10 }' | nc " .. (IP) .. " " .. (Port) .. " ";
print (runcommand);
os.execute(runcommand);
return commandArray;
elseif(devicechanged[DomDevice]=='On') then
print('Arc En ciel Rapide !')
runcommand = "echo '{ \"command\": \"effect\", \"effect\": {\"name\": \"Rainbow swirl fast\" }, \"priority\": 100 }' | " .. (IP) .. " " .. (Port) .. " ";
os.execute(runcommand);
end
end
return commandArray
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
- iMars
- Posts: 8
- Joined: Tuesday 17 November 2015 21:51
- Target OS: Linux
- Domoticz version: Latest
- Contact:
Re: [689] Hyperion integration
Take a good look at your codedeennoo wrote:Got a New probleme,
For fun i want some switch to load and stop effect :
Base on iMars elements i made this script, no lua error but no reaction from hyperion :
Any Idea please ?Code: Select all
commandArray = {} DomDevice = 'Hyperion Arc en Ciel' --name device IP = '192.168.0.245' -- ip address hyperion Port = '19444' if devicechanged[DomDevice] then if(devicechanged[DomDevice]=='Off') then print('Turn '..DomDevice..' off...') runcommand = "echo '{ \"command\": \"clear\", \"priority\": 10 }' | nc " .. (IP) .. " " .. (Port) .. " "; print (runcommand); os.execute(runcommand); return commandArray; elseif(devicechanged[DomDevice]=='On') then print('Arc En ciel Rapide !') runcommand = "echo '{ \"command\": \"effect\", \"effect\": {\"name\": \"Rainbow swirl fast\" }, \"priority\": 100 }' | " .. (IP) .. " " .. (Port) .. " "; os.execute(runcommand); end end return commandArray
You can run the command from a terminal (I work on a Mac, If you work on Windows, ssh with putty to domoticz or your hyperion linux ).
I ran your command: echo '{ "command": "effect", "effect": {"name": "Rainbow swirl fast" }, "priority": 10 }' | <my ip> 19444 and it didn't work... because you've forgotten the "nc" right after the "|" before your <ip>
The right syntax is: echo '{ "command": "effect", "effect": {"name": "Rainbow swirl fast" }, "priority": 10 }' | nc <your ip> 19444
I fixed your code:
Code: Select all
commandArray = {}
DomDevice = 'Hyperion Arc en Ciel' --name device
IP = '192.168.0.245' -- ip address hyperion
Port = '19444'
if devicechanged[DomDevice] then
if(devicechanged[DomDevice]=='Off') then
print('Turn '..DomDevice..' off...')
runcommand = "echo '{ \"command\": \"clear\", \"priority\": 10 }' | nc " .. (IP) .. " " .. (Port) .. " ";
print (runcommand);
os.execute(runcommand);
-- skip this, its not needed -- return commandArray;
elseif(devicechanged[DomDevice]=='On') then
print('Arc En ciel Rapide !')
runcommand = "echo '{ \"command\": \"effect\", \"effect\": {\"name\": \"Rainbow swirl fast\" }, \"priority\": 10 }' | nc " .. (IP) .. " " .. (Port) .. " ";
os.execute(runcommand);
end
end
return commandArray
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
Thanks for this what mean "nc" ?
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
Small improvement for those who run Domoticz on a Syno and want to use netcat command.
It appear that Netcat on a Syno stay ON and don't kill connection this give an error on Domoticz Log because LUA script run more than 10 secondes, and Domoticz freeze during this time.
You just have to had -c value to your netcat command, this give :
No more error anymore
It appear that Netcat on a Syno stay ON and don't kill connection this give an error on Domoticz Log because LUA script run more than 10 secondes, and Domoticz freeze during this time.
You just have to had -c value to your netcat command, this give :
Code: Select all
runcommand = "echo '{ \"command\": \"effect\", \"effect\": {\"name\": \"Rainbow swirl fast\" }, \"priority\": 10 }' | nc -c " .. (IP) .. " " .. (Port) .. " ";
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 92
- Joined: Thursday 18 May 2017 8:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Left
- Contact:
Re: [689] Hyperion integration
I don't know if anybody is intereseted, but i made a python plugin (for the beta version):
https://github.com/ericstaal/domoticz/t ... n/hyperion
Allows you to control rgb values and select mode
https://github.com/ericstaal/domoticz/t ... n/hyperion
Allows you to control rgb values and select mode
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: [689] Hyperion integration
will test it this night ! thx !
Some question about it : did you parse effect from hyperion or did your already write on plugin usual effect ?
how to install it ? just paste the plugin.py file ?
Some question about it : did you parse effect from hyperion or did your already write on plugin usual effect ?
how to install it ? just paste the plugin.py file ?
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Who is online
Users browsing this forum: No registered users and 0 guests