Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

copy state of Hue Lamp, and set another to that exact state.


Question

Posted (edited)

Hi, It's been a while since I made a topic here on the forum. Everything works smoothly as it should.
That's why I haven't touched my HC3 or made scenes for it for quite a while, and so not sure how to do the next thing.

 

All my lights are Phillips Hue, i only have one quickapp turning some lamps off with a motion sensor.
The rest is all controlled by a i-casa wall controller. This controller works with touch link. So "outside" of the homecenter.
This works perfect for me, since i can set the status of all lamps, and long press a wall button and it will remember the state of them all.

 

I have ordered a LED strip with zigbee controller. This one comes in today. But i just found out that touchlink won't work with this thing at all.

So I can't control this LED strip with the i-casa touchlink in-wall controller.
I can send it back and buy a Hue strip three times the price.

 

Or I can ask for your help :)

 

This LED strip will register as a Hue integration in the HC3 via the Hue hub. Just like the rest of the lamps. (or at least i hope so)

 

What I want to achieve:

 

When "kitchen lamp" turns on, the LED strip copies the status. So on or off AND the color state.

Below is the status output of the lamp i would like the led strip status to follow. (when turning on)

Quote

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_MAIN_139]: [HG] QA:188 Change in QA Woonkamer-Keuken

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_MAIN_139]: QA:188 any_on: false -> true

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_MAIN_139]: QA:188 Last Update: 27.07.2022 09:20:16

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_LIGHT_188]: [L] Setting label value to lblState 2 - Partially On

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_LIGHT_188]: [L] Setting value to sldBrightness 32

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_LIGHT_188]: [L] Setting value to sldHue 78

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_LIGHT_188]: [L] Setting value to sldSaturation 76

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_LIGHT_188]: [L] Setting value to sldCt 100

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_LIGHT_188]: [L] Setting label value to lblLastUpdate 27.07.2022 09:20:16[

27.07.2022] [09:20:16] [DEBUG] [QA_HUE_LIGHT_188]: [L] updateInfo:

[27.07.2022] [09:20:16] [DEBUG] [QA_HUE_LIGHT_188]: Off 2.5W


 

Please login or register to see this code.

Can someone help me with that?
 

Edited by ppeterr

Recommended Posts

  • 1
  • Inquirer
  • Posted

    So maybe it is a better idea to fetch variable.properties.color from the json output.

    And use those numbers for the setcolor.

     

    But you know me, my brain crashed also a few times now :)

    • 0
    Posted

    What QA are you using?

    A color device should set the color property (RGB(W)) so it should be possible to make a scene that triggers on the state and/or color value of a light and then sets another light to the same values.

    • 0
  • Inquirer
  • Posted (edited)
    16 minutes ago, jgab said:

    What QA are you using?

    A color device should set the color property (RGB(W)) so it should be possible to make a scene that triggers on the state and/or color value of a light and then sets another light to the same values.

     

    I am using petrkl12 his Huemain quickapp.

     

    I think it should be something like this, only then with the variable's from his quickapp for the color.

     

    sldBrightness

    sldHue

    sldSaturation

    sldCt

     

     

     

    Please login or register to see this attachment.

     

     

    Edited by ppeterr
    • 0
    Posted

    You should be able to use

    Please login or register to see this code.

    and then in the action check the state/value of the light and set the other light to the same.

     

    If @petrkl12 sets the 'color' property you should be able to trigger on that property to and then do a fibaro.call(otherDevice,"setColor",color) ...

     

    • 0
  • Inquirer
  • Posted (edited)
    26 minutes ago, jgab said:

    You should be able to use

    Please login or register to see this code.

    and then in the action check the state/value of the light and set the other light to the same.

     

    If @petrkl12 sets the 'color' property you should be able to trigger on that property to and then do a fibaro.call(otherDevice,"setColor",color) ...

     

     

    I have about six color scene's i'd like it to follow, so i think i indeed need to read out the property value of that device.

     

    [27.07.2022] [13:03:30] [DEBUG] [QA_HUE_MAIN_139]: [HA] ActionToggle_QAHue - Woonkamer-Hue Centris ceiling 3

    Edited by ppeterr
    • 0
  • Inquirer
  • Posted

    So, i recieved the lightstrip. And added it to the Hue hub. And it shows up in the Hue_main quickapp.

     

    I made a scene, so that lightstrip turns on when another light in the kitchen turns on.

     

    trigger

     

    Please login or register to see this code.

     

    action

     

    Please login or register to see this code.

     

    So when lamp 416 turns on the strip turns on. Well i got something working yeah :)

     

    When i look at the console, it comes up like this

     

    Please login or register to see this code.

     

    So, next thing is setting those value's above to what the actual color is of ID 416 

     

    Any help would be greatly appreciated!

    • 0
    Posted (edited)

    Not that into the colors, but should 

     

    Please login or register to see this code.

     

    be something like:

     

    Please login or register to see this code.

     

     

     

    Edited by SmartHomeEddy
    • 0
  • Inquirer
  • Posted
    7 minutes ago, SmartHomeEddy said:

    Not that into the colors, but should 

     

    Please login or register to see this code.

     

    be something like:

     

    Please login or register to see this code.

     

     

     

     

    Hi eddy :)

     

    That actually works. And sets a certain color. But i need the value's nnnred, nnngreen, nnnblue, nnnwhite from another device.

    And then insert those into the syntax. So the color will be the same.

     

    Please login or register to see this code.

     

    • 0
    Posted (edited)

    ahh, does this work to get the colors?

     

    local colors = fibaro.getValue(416,"color")

     

     

    I don't know if that works, otherwise you could also get all parameters from a device with:

    Please login or register to see this code.

     

    Edited by SmartHomeEddy
    • 0
  • Inquirer
  • Posted
    7 minutes ago, SmartHomeEddy said:

    ahh, does this work to get the colors?

     

    local colors = fibaro.getValue(416,"color")

     

    Not sure if i understand you there, does it have to look like this then ?

     

    Quote

    local colors = fibaro.getValue(416,"Color")

    fibaro.call(418, "setColor")

     

    • 0
  • Inquirer
  • Posted

    For sure not, since it crashed something. Messed up the Hue stuff on the hc3 :)  -  reboot

    • 0
    Posted (edited)

    If it works, haven't done it before, I would expect a table from the getValue. With the fibaro.call it would be like this:

     

    Please login or register to see this code.

    18 minutes ago, ppeterr said:

    For sure not, since it crashed something. Messed up the Hue stuff on the hc3 :)  -  reboot

     

     

    17 minutes ago, SmartHomeEddy said:

    If it works, haven't done it before, I would expect a table from the getValue. With the fibaro.call it would be like this:

     

    Please login or register to see this code.

     

    Or it just crashes your HC3 ?

    Edited by SmartHomeEddy
    • 0
  • Inquirer
  • Posted
    local colors = fibaro.getValue(416,"color")
    fibaro.call(418, "setColor", color[1],color[2],color[3],color[4])
     
    [28.07.2022] [17:30:04] [ERROR] [SCENE101]: (load):2: attempt to index a nil value (global 'color')

    Those are not globals i think, it must be something else. Since it is a child from the Huemain quickapp.

    I think those value's are stored different....or something, dunno.......

    29 minutes ago, SmartHomeEddy said:

     

    I don't know if that works, otherwise you could also get all parameters from a device with:

    Please login or register to see this code.

     

     

    Maybe, but the idea is that it follows the scene/color from that other lamp. So it is dynamic.

    • 0
  • Inquirer
  • Posted

    But it gives this info

     

    Please login or register to see this code.

     

    Now we only need to filter out "color":"255,203,67,0" and use that every time it switches on :)

    • 0
    Posted (edited)
    13 minutes ago, ppeterr said:
    local colors = fibaro.getValue(416,"color")
    fibaro.call(418, "setColor", color[1],color[2],color[3],color[4])


    Oeps, it needs and extra s (colors is the variable)

     

     

     

    Edited by SmartHomeEddy
    • 0
  • Inquirer
  • Posted

    i filled in those value's and it actually matches the color. Only strange thing is i need to click the scene about 10 times :)

     

    it cycle's through some colors, and then ends up in the correct one.

    • 0
    Posted

    It works with the getValue and fibaro.call(“setcolor”) ?

    • 0
  • Inquirer
  • Posted
    Just now, SmartHomeEddy said:

    It works with the getValue and fibaro.call(“setcolor”) ?

     

    No no, i just used the numbers from http://192.168.1.65/api/devices/416

     

    id":416,e":"afzuigkap rechts","roomID":220,"view":[{"assetsPath":"","name":"com.fibaro.colorController","translatesPath":"/assets/i18n/com.fibaro.colorController","type":"ts"},{"assetsPath":"","name":"level-change","translatesPath":"/assets/i18n/level-change","type":"ts"},{"type":"json"}],"type":"com.fibaro.philipsHueLight","baseType":"com.fibaro.colorController","enabled":true,"visible":true,"isPlugin":true,"parentId":34,"viewXml":true,"hasUIView":false,"configXml":false,"interfaces":["levelChange","light"],"properties":{"alert":0,"brightness":254,"categories":["lights"],"color":"255,203,67,0","colorComponents":{},"colormode":"ct","currentProgram":0,"dead":false,"deadReason":"","deviceControlType":51,"deviceIcon":15,"deviceRole":"Rgb","effect":0,"hue":7856,"icon":{"path":"plugins/com.fibaro.philipsHueLight/img/icon.png","source":"HC"},"isLight":true,"lightId":17,"log":"","logTemp":"","manufacturer":"","model":"","on":true,"reachable":true,"saturation":188,"saveLogs":true,"state":true,"supportedDeviceRoles":["Rgb","Rgbw"],"userDescription":"","value":100},"actions":{"setColor":1,"setColorComponents":1,"setValue":1,"startColorEnhancement":1,"startColorFade":1,"startLevelDecrease":0,"startLevelIncrease":0,"stopColorChange":1,"stopLevelChange":0,"toggle":0,"turnOff":0,"turnOn":0},"created":1658853619,"modified":1659021882,"sortOrder":128}

    6 minutes ago, SmartHomeEddy said:


    Oeps, it needs and extra s (colors is the variable)

     

     

     

     

    Uhhhhh where

    • 0
    Posted (edited)
    5 minutes ago, ppeterr said:

    Uhhhhh where


    like this

     

    Please login or register to see this code.

     

     

    5 minutes ago, ppeterr said:

    No no, i just used the numbers from http://192.168.1.65/api/devices/416


    That is a json string:

     

    Please login or register to see this attachment.

     
     

    It is at variable.properties.color

     

     

     

    Edited by SmartHomeEddy
    • 0
  • Inquirer
  • Posted (edited)
    5 minutes ago, SmartHomeEddy said:


    like this

     

    Please login or register to see this code.

     

    Nothing,   it didnt crash either :P

     

    Correction, it did - unresposive :P LOL

    Edited by ppeterr

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...