Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - platform: rest
- name: Eliot
- resource: https://app.visionq.cz/api/device_last_measurement.php?eui=XXXXXXXXX
- username: xxxxx
- password: xxxxx
- authentication: basic
- scan_interval: 900
- value_template: '1'
- json_attributes:
- - low_rate_kwh
- - high_rate_kwh
- - timestamp
- - battery_state
- - network
- - snr
- - platform: template
- sensors:
- eliot_energy_low:
- value_template: '{{ states.sensor.eliot.attributes["low_rate_kwh"] }}'
- device_class: power
- unit_of_measurement: kWh
- eliot_energy_high:
- value_template: '{{ states.sensor.eliot.attributes["high_rate_kwh"] }}'
- device_class: power
- unit_of_measurement: kWh
- eliot_last_update:
- value_template: '{{ states.sensor.eliot.attributes["timestamp"] }}'
- device_class: timestamp
- eliot_updated_ago:
- value_template: >-
- {% set last_updated = states.sensor.eliot.attributes["timestamp"] %}
- {% set seconds = now().timestamp()-last_updated %}
- {% set hours = seconds / 3600 %}
- {% if seconds / ( 60 * 60 ) > 1 %}
- {{ (seconds // ( 60 * 60 ))|int }} hod
- {% else %}
- {{ (seconds // 60)|int }} min
- {% endif %}
- eliot_battery:
- value_template: '{{ (states.sensor.eliot.attributes["battery_state"] | int / 254) * 100 | int }}'
- device_class: battery
- eliot_network:
- value_template: '{{ states.sensor.eliot.attributes["network"] }} '
- eliot_snr:
- value_template: '{{ states.sensor.eliot.attributes["snr"] }} '
- device_class: signal_strength
- unit_of_measurement: dB
- - platform: template
- sensors:
- hourly_energy:
- friendly_name: Hourly Energy
- unit_of_measurement: kWh
- value_template: "{{ states('sensor.hourly_energy_offpeak')|float + states('sensor.hourly_energy_peak')|float }}"
- daily_energy:
- friendly_name: Daily Energy
- unit_of_measurement: kWh
- value_template: "{{ states('sensor.daily_energy_offpeak')|float + states('sensor.daily_energy_peak')|float }}"
- monthly_energy:
- friendly_name: Monthly Energy
- unit_of_measurement: kWh
- value_template: "{{ states('sensor.monthly_energy_offpeak')|float + states('sensor.monthly_energy_peak')|float }}"
Add Comment
Please, Sign In to add comment