Burningstone91 / Hue_Dimmer_Deconz

AppDaemon app for controlling a Hue Dimmer Switch integrated through Deconz
MIT License
20 stars 4 forks source link

Executing script / shell command on long-press via "service_call" #12

Open swanitzek opened 3 years ago

swanitzek commented 3 years ago

Hello,

I want to execute a script after the "Off" button of my Hue Dimmer switch has been pressed. It looks like executing a script via the action_type "servie_call" is not supported or do I miss something?

apps.yaml

dimmer_livingroom:
  module: hue_dimmer_switch_deconz
  class: HueDimmerSwitch
  entities:
    switch: dimmer_switch
    light: light.wohnzimmer
  transitiontime: 1
  advanced:
      long_press_off_release:
      action_type: service_call
      entity: script.turn_off_tv

scripts.yaml:

turn_off_tv:
    sequence:
      service: shell_command.tv_off

configuration.yaml

shell_command:
  tv_off: python3 -m samsungctl --host=192.168.x.x --name HomeAssistant KEY_POWEROFF

Executing the script via Lovelace works like a charm. Is there any way to implement the functionality?