I’d like to create a command-line sensor that takes the value from an existing sensor (e.g. sensor.dark_sky_hourly_summary) and runs a command with that parameter returning some output (in this case the translation of that string). Other use cases may also be useful.
Example configuration:
sensor:
- platform: templated_sensor_command_line
name: Weather forecast
scan_interval: '00:15'
command: '/usr/local/bin/trans -b :ro "{{ sensor.dark_sky_hourly_summary }}" '
I’ve copied /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/command_line.py
and tried to change it a bit along the suggestion in this thread: Pass value to command line and pass the command through a template.render call. Here is my current code, but unfortunately my python skills (and API knowledge) are limited, so it doesn’t work: https://pastebin.com/p1Agpqmu
I’d like to ask for help, and also, I want to know if such a feature will become a default option for these types of sensors.