Hi
I'm trying to assign multiple lights to a single controller.
I know I can group them, but I'd like to avoid that.
Are dictionaries as light: supported?
And if so, how do I define them
Thanks :)
IKEA 1810 as Controllerdeconzv4.0.2.3v2.3.1v0.22.1v0.106.4N/A
N/A
As pr. the documentation, the key can either be string or dictionary. And furthermore, if lights is a dictionary, I should provide a name.
I assume a config like this would be valid:
awesome_controller:
module: controllerx
class: E1810Controller
controller: mah_remote
integration: deconz
light:
- name: light.greatest
- name: light.awesomest
I looked at code too, and it seems to be aware of using dics
But this bit confuses me. Doesn't seem to account for string/dic.
Hi @terle,
Thanks for the question. The light attribute does not accept a list, just a dictionary or string. You are adding "-" and that is a list in YAML, this is why it is not working (with your configuration light is a list, not a string or dict). Also, ControllerX does not support that and it is not part of the roadmap since it will need to take care to turn on/off every single light, something that HA manages already pretty well with groups. If you do not want to create a group of lights, which is the recommended way and I do not see a reason for not doing so, you can also do the following:
great_controller:
module: controllerx
class: E1810Controller
controller: mah_remote
integration: deconz
light: light.greatest
awesome_controller:
module: controllerx
class: E1810Controller
controller: mah_remote
integration: deconz
light: light.awesomest
Since AppDaemon allows create different instance apps, you can create one for one light and one for the other and use the same controller for both. However, if you create a group as easy as:
kitchen_lights:
name: Kitchen lights
entities:
- light.kitchen1
- light.kitchen2
Then you just need to do:
kitchen_controller:
module: controllerx
class: E1810Controller
controller: mah_remote
integration: deconz
light: group.kitchen_lights
I hope this helped :)
Hi @xaviml
Thank you for the elaborate answer :)
I see now, there's a difference between a list and dic. Thank for making my yaml-fu stronger
And thank you also for making controllerX. You really helped to make my life much eaiser.
No worries, thank you for your appreciation, I know what creating a HA automation is like when it comes to giving functionality to controllers. In the end, everyone would do the same complex automations. I am glad I made your life easier :)
P.S. I edited my answer since there was a typo in the yaml configuration.
Most helpful comment
Hi @terle,
Thanks for the question. The light attribute does not accept a list, just a dictionary or string. You are adding "-" and that is a list in YAML, this is why it is not working (with your configuration
lightis a list, not a string or dict). Also, ControllerX does not support that and it is not part of the roadmap since it will need to take care to turn on/off every single light, something that HA manages already pretty well with groups. If you do not want to create a group of lights, which is the recommended way and I do not see a reason for not doing so, you can also do the following:Since AppDaemon allows create different instance apps, you can create one for one light and one for the other and use the same controller for both. However, if you create a group as easy as:
Then you just need to do:
I hope this helped :)