Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #HASS CONFIG FILE
- sensor:
- #These 2 sensors read the data coming from the Arduino
- - platform: mqtt
- name: "Energy Sensor L1"
- state_topic: "sensor/power/L1"
- unit_of_measurement: 'A'
- icon: mdi:power-plug
- - platform: mqtt
- name: "Energy Sensor L2"
- state_topic: "sensor/power/L2"
- unit_of_measurement: 'A'
- icon: mdi:power-plug
- #This template sensor combines the 2 above sensors to provide a total amperage usage
- - platform: template
- sensors:
- total_power_usage:
- value_template: '{{ ((states.sensor.energy_sensor_l1.state | float) +
- (states.sensor.energy_sensor_l2.state | float)) | round(1) }}'
- friendly_name: 'Total Power Usage (A)'
- unit_of_measurement: 'A'
- icon_template: mdi:power-plug
- #This template sensor calculates wattage from the total power usage in amps (above sensor)
- - platform: template
- sensors:
- total_power_watt:
- friendly_name: "Total Power Usage (W)"
- unit_of_measurement: W'
- value_template: "{{ (states('sensor.total_power_usage')|float * 120) | round(1) }}"
- icon_template: mdi:power-plug
- #This sensor provides a cumulative kWh value from the total wattage (above sensor)
- - platform: integration
- source: sensor.total_power_watt
- name: energy_spent
- unit_prefix: k
- round: 2
- #Utility Meter integration which pulls data from energy_spent (above sensor)
- utility_meter:
- daily_energy:
- name: "Daily Power Usage"
- source: sensor.energy_spent
- cycle: daily
- monthly_energy:
- name: "Monthly Power Usage"
- source: sensor.energy_spent
- cycle: monthly
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement