I think I can do this myself based of the existing code, but a thought for a feature request. Custom Integration option?
One of my use cases is I use Lutron Pico remotes using the lutron-caseta-pro custom component, which pushes the pico button presses to sensors. What I was thinking was using automations to fire events based on the sensor changes. I could get press and release events for each button as the sensor. I could fake this by making the events match a current integration in the code, but was wondering if a custom integration method would make more sense. I know dimming from the Lutron Pico’s comes up from time to time on the forums.
First of all, thanks for the appreciation. If I understand correctly the lutron-caseta-pro maps the button states into sensors. I see that when no button is pressed the state of the sensor is 0, but when is pressed, it follows this mapping and then go back to 0. If this is correct, you will need to listen for states, which is what z2m integration does already. However, I think is a good idea to create a custom integration where you can set if you are listening for state or event and in case of event, what type of event, etc. I will consider this as a feature request, but in the meantime, the z2m integration should do the work.
I just released a beta version v2.3.0b2 with support to custom controllers, so you can map the button states to actions through yaml configuration. You can check the documentation for it in here. If you have any questions or you need help with the configuration, you can just sent a PM
2020-02-19 04:01:42.376908 INFO AppDaemon: Initializing app pico_app using class CustomLightController from module controllerx
I can see the state changes for my sensor in HA, but don’t get any dimming/on/off.
I confirmed that the issue is the raw numbers as the state of the sensor - I set up some rest_commands to create a new sensor via HA rest api based on the numeric values and using that as the sensor it works as expected.
Since the remove returns to 0 after a press, is there any way to register holds, in addition to clicks? I’m able to use a hold or a click but not both. I guess that would need some logic to differentiate the click vs the hold.
I also quoted “off” otherwise it gets parsed as a false value.
I am afraid this is not possible. This is a problem of the custom component, it should send a different state for click than hold, the same that z2m, deconz and zha does.
Estimado @xaviml :
He instalado el controller de Ikea E1810 configurado mediante el Sniffer USB ConBee2 (deconz) en HA. Mediante Automations y Scenes lo he conseguido hacer funcionar, pero no lo logro con tu ControllerX v2.2.1 que he instalado desde HACS.
Dentro del directorio config de HA, he entrado a la carpeta appdaemon y ahí dentro hice “sudo nano apps.yaml” y configuré lo siguiente:
Primero de todo, has instalado el addon de AppDaemon? ControllerX se ejecuta por encima de AppDaemon. Puedes leer más sobre ello aquí. Una vez instalado entonces puedes copiar la configuración que mencionas.
Segundo, la configuración que has pasado está bien excepto el constrain_input_boolean que no te hace falta. Tu configuración quedaría:
@xaviml Thanks! I thought that HACS appdaemon enable would get thing going, but I was wrong.
I have now installed AppDaemon, but still there is some errors:
root@odroid:~/appdaemon# sudo systemctl status [email protected]
● [email protected] - AppDaemon
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-02-21 10:27:29 UTC; 7s ago
Main PID: 31340 (appdaemon)
CGroup: /system.slice/system-appdaemon.slice/[email protected]
└─31340 /usr/bin/python3.7 /usr/local/bin/appdaemon -c /home/homeassistant/.homeassistant/appdaemon
Feb 21 10:27:33 odroid appdaemon[31340]: self.AD, name, self.AD.logging, app_args, self.AD.config, self.app_config, self.AD.global_vars
Feb 21 10:27:33 odroid appdaemon[31340]: File "/usr/local/lib/python3.7/dist-packages/appdaemon/plugins/hass/hassapi.py", line 46, in __init__
Feb 21 10:27:33 odroid appdaemon[31340]: adbase.ADBase.__init__(self, ad, name, logging, args, config, app_config, global_vars)
Feb 21 10:27:33 odroid appdaemon[31340]: File "/usr/local/lib/python3.7/dist-packages/appdaemon/adbase.py", line 75, in __init__
Feb 21 10:27:33 odroid appdaemon[31340]: self.dashboard_dir = self.AD.http.dashboard_dir
Feb 21 10:27:33 odroid appdaemon[31340]: AttributeError: 'NoneType' object has no attribute 'dashboard_dir'
Feb 21 10:27:33 odroid appdaemon[31340]: 2020-02-21 12:27:33.131138 WARNING kitchen_controller: ------------------------------------------------------------
Feb 21 10:27:33 odroid appdaemon[31340]: 2020-02-21 12:27:33.134127 WARNING AppDaemon: Unable to find module livingroom_controller - initialize() skipped
Feb 21 10:27:33 odroid appdaemon[31340]: 2020-02-21 12:27:33.135644 WARNING AppDaemon: Unable to find module kitchen_controller - initialize() skipped
Feb 21 10:27:33 odroid appdaemon[31340]: 2020-02-21 12:27:33.136702 INFO AppDaemon: App initialization complete
muchas gracias por la celeridad en tu respuesta. Efectivamente había pasado por alto el tener que instalar el Add-On Appdaemon. Pensé que con instalar desde HACS tu “script” era suficiente.
En mi caso no sería un Add-On como tal porque tengo HomeAssitant (no Hassio) corriendo bajo docker, por lo que debo instalar el “AppDaemon” como contenedor.
¿Me falta algo por cumplimentar?
Entiendo que debería poder acceder a la URL 3.0.0.55:5050 (en mi caso) para poder gestionar algo, ¿es correcto?
Por último, en cuanto los “Warning”:
2020-02-21 10:43:48.390268 ERROR AppDaemon: time_zone not specified in appdaemon.cfg
2020-02-21 10:43:48.390319 ERROR AppDaemon: latitude not specified in appdaemon.cfg
2020-02-21 10:43:48.390365 ERROR AppDaemon: longitude not specified in appdaemon.cfg
2020-02-21 10:43:48.390417 ERROR AppDaemon: elevation not specified in appdaemon.cfg
Tampoco he encontrado el el fichero appdaemon.cfg, me gustaría por lo menos configurar la zona horaria para evitar posibles problemas, entiendo que la latitud, longitud y altura no son tan relevantes.
Dear @valexi thanks for your answer. Are you running HA under docker as well?
I’m still running HA locally so everything runs under http instead https for me right now: http://MyLocal_IP:8123.
My config file “appdaemon.yaml” removes automatically the “http://” in front of my local IP, so my file looks like this after copy and paste the example of your “appdaemon.yaml”:
Hi I have such a panel ikea FLOALT panel WS 60x60 Model L1529 after configuration works only on / off brightening up / down but when changing the color temperature crashes error that the lamp does not support xy_color or color_temp
2020-02-23 17:13:02.450159 WARNING salon: Unexpected error in worker for App salon:
2020-02-23 17:13:02.451967 WARNING salon: Worker Ags: {'id': 'c4fcac9e3cfe4ca2bd3a16d1980a1291', 'name': 'salon', 'objectid': 'f2c0cf3dcfa646f18d64cb9b00209382', 'type': 'event', 'event': 'deconz_event', 'function': <bound method DeCONZIntegration.callback of <core.integration.deconz.DeCONZIntegration object at 0x753354d8>>, 'data': {'id': 'tradfri_remote_control', 'unique_id': '00:0b:57:ff:fe:9b:8c:51', 'event': 5002}, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'id': 'tradfri_remote_control', '__thread_id': 'MainThread'}}
2020-02-23 17:13:02.453887 WARNING salon: ------------------------------------------------------------
2020-02-23 17:13:02.455829 WARNING salon: Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 725, in async_worker
await funcref(args["event"], data, args["kwargs"])
File "/config/appdaemon/apps/controllerx/core/integration/deconz.py", line 15, in callback
await self.controller.handle_action(data["event"])
File "/config/appdaemon/apps/controllerx/core/controller.py", line 108, in handle_action
await action(*args)
File "/config/appdaemon/apps/controllerx/core/controller.py", line 28, in _action_impl
await method(self, *args, **kwargs)
File "/config/appdaemon/apps/controllerx/core/type/light_controller.py", line 308, in click
attribute = await self.get_attribute(attribute)
File "/config/appdaemon/apps/controllerx/core/type/light_controller.py", line 274, in get_attribute
raise ValueError(
ValueError: This light does not support xy_color or color_temp
2020-02-23 17:13:02.456892 WARNING salon: ------------------------------------------------------------
This message appears because the light does not support color temperature. Can you show me the states attributes of your light from the Developer Tools?