Command line switch - to receive arguments

Hi,

I’d like to have the ability to pass arguments to a command line switch to be able to turn on the switch for a given period of time since the Switcher boiler switch supports it. I saw that the command line switch doesn’t support such functionality - Any way to circumvent this ?

Just to clarify - there’s a method in the Switcher API to enable turning the switch for a given period of time

Thanks !

I’m not sure I understand your question?
The command line switch does allow you to pass parameters to the command

Well, I now understand I may have left some information in my mind…
I have this water boiler switch which in its API there’s an option to accept milliseconds as a parameter for the time you want the boiler to be turned on for

Now, I’d like to be able through HA frontent to enter this parameter manually and to pass it as a parameter to the command line

I hope now it’s better explained

Ok now I understand

I have that exact scenario where I’ve used a slider to alter brightness of a light connected via a shell script

shell_command:
  livingroom_slider: '/bin/bash -c "/scripts/veraDimmer.sh 22 {{states.input_slider.livingroom_brightness.state}} Lounge"'

the slider:

input_slider:
  livingroom_brightness:
    name: Brightness
    min: 0
    max: 100
    step: 5

and the automation:

 - alias: Living Room Light - Adjust Brightness
  initial_state: false
  hide_entity: True
  trigger:
     platform: state
     entity_id: input_slider.livingroom_brightness
  action:
    - service: homeassistant.turn_on
      entity_id: switch.cmd_living_room_light
    - service: shell_command.livingroom_slider

I believe that should give you enough to do what you want :slight_smile:

1 Like

Thanks so much for that, this is probably the exact solution I was looking for, will give it a try and report back my findings

Thanks again