Hello, these two code blocks are causing an error in the yml file, I would appreciate it if you could help me to fix it.
# https://www.speedtest.net/apps/cli
# Template sensors are in configuration.yaml
# Download and test, use binary matching platform, e.g. for x86_64
# wget -qO- https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-x86_64.tgz | tar xvz
# ./speedtest --accept-license --accept-gdpr
# Copy binary to desired HA config folder
# mkdir -p /config/3rdparty/speedtest
# cp ./speedtest /config/3rdparty/speedtest/
sensor:
- platform: command_line
name: "SpeedTest CLI Data"
unique_id: speedtest_cli_data
# Use the path as configured on your system
command: "/config/shell_commands/speedtest --format=json --accept-license --accept-gdpr"
# Every 4 hours, 60 * 60 * 4 = 14400
scan_interval: 14400
command_timeout: 60
# Summarize results to stay below string limit and convert to JSON
value_template: >-
{{
{
"ping": value_json.ping.latency,
"download": value_json.download.bandwidth,
"upload": value_json.upload.bandwidth
}
| to_json
}}
sensor:
- platform: template
sensors:
ipfire_mbps_received:
friendly_name: "Mbps Received"
value_template: "{{ states('sensor.x60_kib_s_received') | multiply (0.001024) | round(1) }}"
unit_of_measurement: 'Mbps'
icon_template: mdi:download-network
ipfire_mbps_sent:
friendly_name: "Mbps Sent"
value_template: "{{ states('sensor.x60_kib_s_sent') | multiply (0.001024) | round(1) }}"
unit_of_measurement: 'Mbps'
icon_template: mdi:upload-network