Reestructuración coches (Xee)
Citroen & Smart
This commit is contained in:
96
packages/pack/coches/citroen.yaml
Normal file
96
packages/pack/coches/citroen.yaml
Normal file
@@ -0,0 +1,96 @@
|
||||
sensor:
|
||||
|
||||
- platform: command_line
|
||||
command: !secret citroen_status
|
||||
name: citroen_status
|
||||
json_attributes:
|
||||
- signals
|
||||
- location
|
||||
- updatedAt
|
||||
value_template: ''
|
||||
scan_interval: 300
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
citroen_bateria:
|
||||
friendly_name: 'Citroen Batería'
|
||||
value_template: >-
|
||||
{% if states.sensor.citroen_status.attributes.signals is defined -%}
|
||||
{% for signals in states.sensor.citroen_status.attributes.signals -%}
|
||||
{% if signals.name == "BatteryVoltage" %}
|
||||
{{ signals.value }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
Recargando.
|
||||
{% endif %}
|
||||
unit_of_measurement: 'V'
|
||||
citroen_velocidad:
|
||||
friendly_name: 'Citroen Velocidad'
|
||||
value_template: >-
|
||||
{% if states.sensor.citroen_status.attributes.signals is defined -%}
|
||||
{% for signals in states.sensor.citroen_status.attributes.signals -%}
|
||||
{% if signals.name == "GpsSpeed" %}
|
||||
{{ signals.value }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
Recargando.
|
||||
{% endif %}
|
||||
unit_of_measurement: 'Km/h'
|
||||
citroen_combustible:
|
||||
friendly_name: 'Citroen Gasolina'
|
||||
value_template: >-
|
||||
{% if states.sensor.citroen_status.attributes.signals is defined -%}
|
||||
{% for signals in states.sensor.citroen_status.attributes.signals -%}
|
||||
{% if signals.name == "FuelLevel" %}
|
||||
{{ signals.value }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
Recargando.
|
||||
{% endif %}
|
||||
unit_of_measurement: 'L'
|
||||
citroen_kilometros:
|
||||
friendly_name: 'Citroen Total Km'
|
||||
value_template: >-
|
||||
{% if states.sensor.citroen_status.attributes.signals is defined -%}
|
||||
{% for signals in states.sensor.citroen_status.attributes.signals -%}
|
||||
{% if signals.name == "Odometer" %}
|
||||
{{ signals.value }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
Recargando.
|
||||
{% endif %}
|
||||
unit_of_measurement: 'km'
|
||||
citroen_revoluciones:
|
||||
friendly_name: 'Citroen Revoluciones por Minuto'
|
||||
value_template: >-
|
||||
{% if states.sensor.citroen_status.attributes.signals is defined -%}
|
||||
{% for signals in states.sensor.citroen_status.attributes.signals -%}
|
||||
{% if signals.name == "EngineSpeed" %}
|
||||
{{ signals.value }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
Recargando.
|
||||
{% endif %}
|
||||
unit_of_measurement: 'tr/min'
|
||||
citroen_fecha_update:
|
||||
friendly_name: 'Citroen Actualización'
|
||||
value_template: "{{ as_timestamp(state_attr('sensor.citroen_status','updatedAt')) | timestamp_custom('%D %-I:%M %P') }}"
|
||||
citroen_latitud:
|
||||
friendly_name: 'Citroen Latitud'
|
||||
value_template: '{{ state_attr("sensor.citroen_status", "location").latitude}}'
|
||||
citroen_longitud:
|
||||
friendly_name: 'Citroen Longitud'
|
||||
value_template: '{{ state_attr("sensor.citroen_status", "location").longitude}}'
|
||||
|
||||
camera:
|
||||
name: Posición Citroen
|
||||
platform: generic
|
||||
still_image_url: !secret camara_citroen
|
||||
limit_refetch_to_url_change: true
|
||||
|
||||
|
||||
83
packages/pack/coches/smart.yaml
Normal file
83
packages/pack/coches/smart.yaml
Normal file
@@ -0,0 +1,83 @@
|
||||
sensor:
|
||||
|
||||
- platform: command_line
|
||||
command: !secret smart_status
|
||||
name: smart_status
|
||||
json_attributes:
|
||||
- signals
|
||||
- location
|
||||
- updatedAt
|
||||
value_template: ''
|
||||
scan_interval: 300
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
smart_bateria:
|
||||
friendly_name: 'Smart Batería'
|
||||
value_template: >-
|
||||
{% if states.sensor.smart_status.attributes.signals is defined -%}
|
||||
{% for signals in states.sensor.smart_status.attributes.signals -%}
|
||||
{% if signals.name == "BatteryVoltage" %}
|
||||
{{ signals.value }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
Recargando.
|
||||
{% endif %}
|
||||
unit_of_measurement: 'V'
|
||||
smart_velocidad:
|
||||
friendly_name: 'Smart Velocidad'
|
||||
value_template: >-
|
||||
{% if states.sensor.smart_status.attributes.signals is defined -%}
|
||||
{% for signals in states.sensor.smart_status.attributes.signals -%}
|
||||
{% if signals.name == "GpsSpeed" %}
|
||||
{{ signals.value }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
Recargando.
|
||||
{% endif %}
|
||||
unit_of_measurement: 'Km/h'
|
||||
smart_kilometros:
|
||||
friendly_name: 'Smart Total Km'
|
||||
value_template: >-
|
||||
{% if states.sensor.smart_status.attributes.signals is defined -%}
|
||||
{% for signals in states.sensor.smart_status.attributes.signals -%}
|
||||
{% if signals.name == "Odometer" %}
|
||||
{{ signals.value }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
Recargando.
|
||||
{% endif %}
|
||||
unit_of_measurement: 'km'
|
||||
smart_revoluciones:
|
||||
friendly_name: 'Smart Revoluciones por Minuto'
|
||||
value_template: >-
|
||||
{% if states.sensor.smart_status.attributes.signals is defined -%}
|
||||
{% for signals in states.sensor.smart_status.attributes.signals -%}
|
||||
{% if signals.name == "EngineSpeed" %}
|
||||
{{ signals.value }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
Recargando.
|
||||
{% endif %}
|
||||
unit_of_measurement: 'tr/min'
|
||||
smart_fecha_update:
|
||||
friendly_name: 'Smart Actualización'
|
||||
value_template: "{{ as_timestamp(state_attr('sensor.smart_status','updatedAt')) | timestamp_custom('%D %-I:%M %P') }}"
|
||||
smart_latitud:
|
||||
friendly_name: 'Smart Latitud'
|
||||
value_template: '{{ state_attr("sensor.smart_status", "location").latitude}}'
|
||||
smart_longitud:
|
||||
friendly_name: 'Smart Longitud'
|
||||
value_template: '{{ state_attr("sensor.smart_status", "location").longitude}}'
|
||||
|
||||
camera:
|
||||
name: Posición Smart
|
||||
platform: generic
|
||||
still_image_url: !secret camara_smart
|
||||
limit_refetch_to_url_change: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user