Get Device Colour

Moderator: leecollings

Post Reply
User avatar
solidum90
Posts: 37
Joined: Tuesday 01 August 2017 20:59
Target OS: NAS (Synology & others)
Domoticz version: Debian
Location: Milan
Contact:

Get Device Colour

Post by solidum90 »

Hi to everyone,
I'm desperate for a chance to get the color set on an RGB device. Via API is not possible, but is there another way to intercept color change command from LUA / dzVents / etc ..?

I would be very useful for me!

Thanks to everyone, have a good Sunday :)
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Get Device Colour

Post by zicht »

Sorry ... not enough information to have a constructive answer.
What kind of rgb device, does it have a webpage or interface somehow ?
What device are we writing about ?
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
User avatar
solidum90
Posts: 37
Joined: Tuesday 01 August 2017 20:59
Target OS: NAS (Synology & others)
Domoticz version: Debian
Location: Milan
Contact:

Re: Get Device Colour

Post by solidum90 »

Hi zicht,
I have several rgb devices, mostly MiLight (5 rgb stripes, 12 rgb+cct GU10 + 8 e27, connected to domoticz via 2 MiLight wifi bridges),
I also have several xiaomi bulbs and stripes, I also had several Philips Hue but I went completely to MiLigh considering great value for money! :D

My purpose is get the color set from domoticz (from scene or dashboard).
From dashboard, for now, I make a workaround:
I use my little dashboard writted in php, when it set a color saves in an xml file along with the device idx, but if the color is set by a domoticz scene I have no way of getting it :'(

Obviously if I set the color by MiLight remote controller or by xiaomi app I do not expect to get, but i'm not interested since I use for 99% domoticz! :mrgreen:
Is it clear now?

Thanks very much!
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Get Device Colour

Post by zicht »

Yes i get the goal, but i do not have these devices :( so its a bit difficult to evaluate.
I suppose you use it similar to https://baptiste-wicht.com/posts/2017/0 ... ystem.html

Thinking out loud :
If the wifi bridge contains a webpage with status of all devices you could read it there. (basically you need to have a source to read the data from)
Or if there is a webpage with an account online there could be an api (i did not find it with google)
Without a source to get the data you are looking for, it will be impossible,
or you need to capture the device signals and store the values somewhere.

If there is a source with data and no api then all depends on the level of security that is involved.
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
User avatar
solidum90
Posts: 37
Joined: Tuesday 01 August 2017 20:59
Target OS: NAS (Synology & others)
Domoticz version: Debian
Location: Milan
Contact:

Re: Get Device Colour

Post by solidum90 »

Thanks again zicht :)

I guess MiLight bridge does not hold anything in it's memory (milight software is not really the best).

But what I can not do is much simpler! Know the color that domoticz sent to the device! :geek:

As I said, I do not expect to know the exactly color set by the MiLight remote, but the one that domoticz sends, for me is the simplest solution.
It works for any RGB device (as it already does with brightness, for example) without having to do something ad-hoc for MiLight, rather than Yeelight, Philips Hue, etc.
Am I wrong?

Just that I just can not intercept the color change event to be able to store it somewhere :(


Regards!
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Get Device Colour

Post by zicht »

Then set a uservariable at the same time you set the color ?
Do you set the color with a device switch or with a script or blocky ?

example :

Code: Select all

If <colorset condition> then commandArray['Variable:color']]="blue" end
or if it is a selector switch :

Code: Select all

if devicechanged['<slectorswitch>']=="blue" then commandArray['Variable:color']]="blue" end
for a physical switch you can get the value by

Code: Select all

otherdevices{'<name>'] 
or detect a change by

Code: Select all

devicechanged['<name>'}
if you use openurl it could be

Code: Select all

commandArray["OpenURL"] = "<linkf or blue>"
commandArray['Variable:color']]="blue"

it is depending on how you set the color :)
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
User avatar
solidum90
Posts: 37
Joined: Tuesday 01 August 2017 20:59
Target OS: NAS (Synology & others)
Domoticz version: Debian
Location: Milan
Contact:

Re: Get Device Colour

Post by solidum90 »

Thanks again zicht ! :)

I try this solution but on print both devicechanged['<name>'] or otherdevices{'<name>'] it always print "Set Level", also in logs :'(

Can you try on your domoticz??
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Get Device Colour

Post by zicht »

Do you use a selector switch ?
in that case Each selector value gives back a unique level.
like :
blue set level 10
red set level 20
etc...
just try and see the diff values...
Once you get it, its straight forward :)
Have a couple of them


or do you have 3 diff color sliders ? Then read the set value for all, the combination of them makes a color (RGB levels)
Sorry i do not have such a device (yet :evil: )...so i cant test right now.
But there has to be a way to discover.
Just make a couple of print to the log with values.
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
User avatar
solidum90
Posts: 37
Joined: Tuesday 01 August 2017 20:59
Target OS: NAS (Synology & others)
Domoticz version: Debian
Location: Milan
Contact:

Re: Get Device Colour

Post by solidum90 »

I use a dimmer (attach two screenshots).

Thanks again! :)
Attachments
Dimmer.png
Dimmer.png (255.64 KiB) Viewed 2870 times
Logs.png
Logs.png (153.46 KiB) Viewed 2870 times
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Get Device Colour

Post by zicht »

Well if you do not get a value somewhere : I do not see how to get the value in a normal way...
Sorry to say i can't help you with this one... maybe somebody else ?
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
User avatar
solidum90
Posts: 37
Joined: Tuesday 01 August 2017 20:59
Target OS: NAS (Synology & others)
Domoticz version: Debian
Location: Milan
Contact:

Re: Get Device Colour

Post by solidum90 »

Thanks anyway zicht, you have been very kind! :)
Both milight and yeelight devices are managed through that type of Dimmer, also the Philips Hue if I remember right...

We are waiting for someone to "enlighten"us :D
User avatar
solidum90
Posts: 37
Joined: Tuesday 01 August 2017 20:59
Target OS: NAS (Synology & others)
Domoticz version: Debian
Location: Milan
Contact:

Re: Get Device Colour

Post by solidum90 »

There aren't any solutions?
User avatar
solidum90
Posts: 37
Joined: Tuesday 01 August 2017 20:59
Target OS: NAS (Synology & others)
Domoticz version: Debian
Location: Milan
Contact:

Re: Get Device Colour

Post by solidum90 »

UPPP
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest