Is there any way to pass value to command line from a slider? I tried searching but couldn’t find what I’m looking for.
Here is an example. I have a slider and input select:
[code]input_slider:
input_lr_fl_bri:
name: “Brightness”
initial: 0
min: 0
max: 255
step: 1
input_select:
input_lr_fl_ct:
name: “Color Temperature”
options:
- Cool
- Soft
- Warm
group:
Living_Room_FL_Control:
name: “Floor Lamps”
entities:
- input_slider.input_lr_fl_bri
- input_select.input_lr_fl_ct[/code]
And let’s say I have something setup like this:
shell_command:
livingroomfloorlamps: ~/shell_scripts/philipshue/group_livingroom '{"on":$1,"ct":$2,"bri":$3,"transitiontime":150}'
I’m controlling a group of lights which simply makes one RESTful API request instead of two. Home Assistant does not expose light groups from my Philips Hue Bridge.
For this task, I would setup 5 automations for two inputs:
[code]automation:
- alias: “LR FL Off”
trigger:- platform: state
entity_id: input_slider.input_lr_fl_br
to: 0
action:
… # Execute the shell script to turn off the living room floor lamps.
- platform: state
- alias: “LR FL On”
trigger:- platform: numeric_state
entity_id: input_slider.input_lr_fl_br
above: 0
action:
… # Execute the shell script to set the desired brightness.Pass in the color temperature if the lights’ previous state is “off”
and now it’s “on.”
- platform: numeric_state
- alias: “LR FL CT Cool” # “Color Temperature”
trigger:- platform: state
entity_id: input_select.input_lr_fl_ct
state: “Cool”
condition:
platform: numeric_state
entity_id: input_slider.input_lr_fl_bri
above: 0
action:
… # Execute the shell script and pass in the “ct” value of “154.”
- platform: state
- alias: “LR FL CT Soft” # “Color Temperature”
trigger:- platform: state
entity_id: input_select.input_lr_fl_ct
state: “Soft”
condition:
platform: numeric_state
entity_id: input_slider.input_lr_fl_bri
above: 0
action:
… # Execute the shell script and pass in the “ct” value of “369.”
- platform: state
- alias: “LR FL CT Warm” # “Color Temperature”
trigger:- platform: state
entity_id: input_select.input_lr_fl_ct
state: “Warm”
condition:
platform: numeric_state
entity_id: input_slider.input_lr_fl_bri
above: 0
action:
… # Execute the shell script and pass in the “ct” value of “500.”[/code]
- platform: state
What can I do to accomplish my task? If only Home Assistant could show me the groups from my Philips Hue bridge.