# Loads default set of integrations. Do not remove. default_config: sensor: - platform: rest name: Power Usage resource: http://192.168.2.4 method: GET headers: Content-Type: application/json value_template: "{{ (value_json.meterReading.powerUsage | float) }}" unit_of_measurement: "W" device_class: power state_class: measurement - platform: rest name: Power Deliver High resource: http://192.168.2.4 method: GET headers: Content-Type: application/json value_template: "{{ (value_json.meterReading.powerDeliverHigh | float) / 1000 }}" unit_of_measurement: "kWh" device_class: energy state_class: total - platform: rest name: Power Deliver Low resource: http://192.168.2.4 method: GET headers: Content-Type: application/json value_template: "{{ (value_json.meterReading.powerDeliverLow | float) / 1000 }}" unit_of_measurement: "kWh" device_class: energy # Added device_class for energy-related sensor state_class: total # Set state_class to total (cumulative) - platform: rest name: Power Return High resource: http://192.168.2.4 method: GET headers: Content-Type: application/json value_template: "{{ (value_json.meterReading.powerReturnHigh | float) / 1000 }}" unit_of_measurement: "kWh" device_class: energy state_class: total - platform: rest name: Power Return Low resource: http://192.168.2.4 method: GET headers: Content-Type: application/json value_template: "{{ (value_json.meterReading.powerReturnLow | float) / 1000 }}" unit_of_measurement: "kWh" device_class: energy state_class: total - platform: rest name: Gas Consumption resource: http://192.168.2.4 method: GET headers: Content-Type: application/json value_template: "{{ (value_json.meterReading.gas | float) / 1000 }}" unit_of_measurement: "m³" device_class: gas state_class: total_increasing - platform: rest name: Voltage L1 resource: http://192.168.2.4 method: GET headers: Content-Type: application/json value_template: "{{ value_json.meterReading.voltageL1 }}" unit_of_measurement: "V" device_class: voltage # Added device_class for voltage sensor state_class: measurement # Set state_class to measurement for real-time values - platform: rest name: Voltage L2 resource: http://192.168.2.4 method: GET headers: Content-Type: application/json value_template: "{{ value_json.meterReading.voltageL2 }}" unit_of_measurement: "V" device_class: voltage # Added device_class for voltage sensor state_class: measurement # Set state_class to measurement for real-time values - platform: rest name: Voltage L3 resource: http://192.168.2.4 method: GET headers: Content-Type: application/json value_template: "{{ value_json.meterReading.voltageL3 }}" unit_of_measurement: "V" device_class: voltage # Added device_class for voltage sensor state_class: measurement # Set state_class to measurement for real-time values - platform: template sensors: total_power_delivered: friendly_name: "Total Power Delivered" unit_of_measurement: "kWh" device_class: energy value_template: "{{ (states('sensor.power_deliver_high') | float) + (states('sensor.power_deliver_low') | float) }}" total_power_returned: friendly_name: "Total Power Returned" unit_of_measurement: "kWh" device_class: energy value_template: "{{ (states('sensor.power_return_high') | float) + (states('sensor.power_return_low') | float) }}"