Hi All.
I am struggling with sending my slider value to my dimmer. The dimmer takes commands as a byte array so use netcat to send the commands. I have the following in my configuration.yaml:
light:
- platform: template
lights:
drop_virtual:
friendly_name: "Dråber"
turn_on:
service: shell_command.led_on
turn_off:
service: shell_command.led_off
set_level:
service: shell_command.led_brightness
data_template:
bri: '{{ (brightness /255*1024) | int }}'
shell_command:
led_on: echo Fadetimer2=2000,LED2_Target=100 | nc -w 2 10.100.1.50 43333
led_off: echo Fadetimer2=2000,LED2_Target=-1 | nc -w 2 10.100.1.50 43333
led_brightness: echo -e "Fadetimer2=2000,LED2_Target={{bri}}" | nc -w 2 10.100.1.50 43333
My On and Off commands work
But the led_brightness command does not. In the log I get the following:
2020-10-04 20:47:08 DEBUG (MainThread) [homeassistant.components.shell_command] Stdout of command: `echo -n "Fadetimer2=2000,LED2_Target={{bri}}" | nc -w 2 10.100.1.50 43333`, return code: 0:
b'Fadetimer2=2000,LED2_Target=771 | nc -w 2 10.100.1.50 43333'
If I run the command in my terminal it works .
Any ideas why the heck it does not work when triggered from HA?
Any suggestions are welcome