delfick / photons

Python3.6+ asyncio framework for interacting with LIFX devices

Home Page:https://photons.delfick.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[interactor] Making scene doesn't work on candles

delfick opened this issue · comments

As reported in #61, creating a scene on a candle records a single colour instead of the matrix of zones.

@pimw1 I'm pushing out this fix and when https://github.com/delfick/photons/runs/3331419646?check_suite_focus=true is done I'll push out the change to the homeassistant plugin and let you know.

@pimw1 homeassistant should have the update now to go into version 0.9.1 and then it should work. Do reopen this issue if it doesn't.

commented

Thank you delfick! I'll check it next week.

commented

Sorry for the late reply, due to personal circumstances, i was unable to continue sooner. Anyhow, i'm back on track. I've installed version 0.91 and it is correctly capturing the matrix zones for the candle lights. Awesome. Thank you very much for the fix!

I've a small question: is it possible to apply a transition time (e.g. 2 seconds) when calling a scene? For example:

Creating the scene:
curl -XPUT http://192.168.178.2:6100/v1/lifx/command
-HContent-Type:application/json
-d '{"command":"scene_capture", "args":{"label":"overdag","uuid":"overdag","matcher":{"serial":["d073dxxxxxx","d073dyyyyy"]}}}'

Applying the scene
curl -XPUT http://192.168.178.2:6100/v1/lifx/command
-HContent-Type:application/json
-d '{"command":"scene_apply", "args":{"uuid":"overdag"}}'

It works beautifully, but is there a way to add a transition time to it?

Try adding an "overrides": {"duration": 2} to the args.

commented

Very nice, that did the trick! I was trying "overrides": {"transition": 2} with no luck ;)

Is there any place where these kind of tips&tricks are documented? I could not find all information on https://photons.delfick.com/ (i could be overlooking some stuff).

Documentation is not one of my strong suits hahahah (and also the nature of how this project came to be meant the priority is more about doing something for enjoyment).

So essentially the best place becomes the source code or just living in my head :p

There will hopefully come a point next year where I've had the chance to properly recover from a truly horrible two years and I can put more time into photons again and continue to work towards improving these things.

commented

Yeah, i fully get it. Making documentation sucks big time haha. And it is hobby project that you are doing in your free time, it should be fun. Your work and help is really appreciated, keep up the good work!

thanks :)

commented

By the way, i'm making some dynamic restfull commands in home assistant so i've a more easy time when creating new automations. For example:

rest_command:
  lifx_scene_apply:
  url: 'http://127.0.0.1:6100/v1/lifx/command'
  method: "put"
  payload: |
    {
      "command": "scene_apply",
      "args": {
        "uuid":"{{scene}}",
        "overrides": {
          "duration": {{duration}}
        }
      }
    }

In the automation, i'm using the following:
image

Anyhow, i've a question: is there an override attribute for color temperature (ideally in Kelvin)?

commented

Aah i found it," kelvin" should work (e.g. value of 3500)

rest_command:
  lifx_scene_apply:
  url: 'http://127.0.0.1:6100/v1/lifx/command'
  method: "put"
  payload: |
    {
      "command": "scene_apply",
      "args": {
        "uuid":"{{scene}}",
        "overrides": {
          "duration": {{duration}},
          "kelvin":{{kelvin}}
        }
      }
    }

noice :)

commented

I had quite some stability issues yesterday, despite my rock-solid dedicated 2.4 Ghz network from my Unifi AC Pro. I've quite some devices on my network, so i followed your advice of applying hardcoded discovery in lifx.yml

discovery_options:
  hardcoded_discovery:
    d073d5000001: "192.168.0.1"
    d073d5000002: "192.168.0.2"

And the good news is, it works flawlesly since that moment onwards! Happy days.

commented

Yeah i am happy that it works! At the same time, i don't get why Lifx lights are sooo sensitive for these connectivty issues. Literly all my other devices are working 99.9% smoothly, and Lifx only like 90% (which is not enough for a smart bulb). I am glad that Photons Interactor is a good solution for that, well done.

commented

Yeah, and i'm aware this is your hobby project, instead of your official job at Lifx. So i won't continue here about Lifx connectivity capabilities in general, it would not a be appropiate to do. Let's focus on the good stuff of Photons Interactor!

Speaking of which, do you know any solution for this? I've made another RestAPI Service in Home Assistant which is also incorporating the brightness variable. However, when not providing this value, the call won't succeed. In the majority of cases, i don't want to provide an override brightness value because it makes all sections in the bulb matrix equally bright (which is not nice to look at).

Is there a way to provide some kind of a "NA" / null value to Photons Interactor, so that it will leave the brightness of the scene untouched? In this way, i only need one RestAPI service instead of two (one with and one without the brightness variable).

  lifx_scene_apply_brightness:
    url: 'http://127.0.0.1:6100/v1/lifx/command'
    method: "put"
    payload: |
      {
        "command": "scene_apply",
        "args": {
          "uuid":"{{scene}}",
          "overrides": {
            "duration": {{duration}},
            "brightness": {{brightness}}
          }
        }
      }

Yeah, and i'm aware this is your hobby project, instead of your official job at Lifx

Especially since I don't work there anymore since July :p

Is there a way to provide some kind of a "NA" / null value

Sure, I can make that happen. So if you provide null then it is the same as not specifying the override at all. That's a code change, but it should be easy.

commented

That would be so cool! Is it possible to do the same for other variables, such as kelvin?

commented

By the way, with that stuff in place, we are already getting pretty close to an alpha version of some kind of Home Assistant HACS Integration ;)

That would be so cool! Is it possible to do the same for other variables, such as kelvin?

yeap, all things in overrides. Essentially a

overrides = {overrides but without values that are none}

before the rest of the command

By the way, with that stuff in place, we are already getting pretty close to an alpha version of some kind of Home Assistant HACS Integration ;)

:)

@pimw1 I've released 0.10.1 with that change.

Any value in overrides when you do a scene_apply will be ignored :)

commented

Awesome!! i'll check it when i'm back from my holidays.

nice, enjoy your holiday!

commented

thanks!