Using REST Sensors with Energy

I am trying to use my home energy capture device with the Energy Dashboard

I cant get the sensor configured correctly as I cant find any real docs on how to set them up and the few tidbits ofinfo I have gotten dont work.

I have 6 Buckets that just count up as Ws (Watt Seconds)

  - scan_interval: 60
    resource: http://power._____.us/current-sample
    sensor:
      - name: "Consumption Watts"
        device_class: power
        unit_of_measurement: "W"
        value_template: "{{ value_json.channels[4].p_W }}"
      - name: "Consumption volts"
        device_class: voltage
        unit_of_measurement: "V"
        value_template: "{{ value_json.channels[4].v_V }}"
      - name: "Consumption Energy Imported"
        device_class: energy
        state_class: measurement
        unit_of_measurement: "Wh"
        value_template: "{{ value_json.channels[4].eImp_Ws }}"
      - name: "Consumption Energy Exported"
        device_class: energy
        state_class: measurement
        unit_of_measurement: "Wh"
        value_template: "{{ value_json.channels[4].eExp_Ws }}"
      - name: "Net Watts"
        device_class: power
        unit_of_measurement: "W"
        value_template: "{{ value_json.channels[2].p_W }}"
      - name: "Net Volts"
        device_class: voltage
        unit_of_measurement: "V"
        value_template: "{{ value_json.channels[2].v_V }}"
      - name: "Net Energy Imported"
        state_class: measurement
        device_class: energy
        unit_of_measurement: "Wh"
        value_template: "{{ value_json.channels[2].eImp_Ws }}"
      - name: "Net Energy Exported"
        device_class: energy
        state_class: measurement
        unit_of_measurement: "Wh"
        value_template: "{{ value_json.channels[2].eExp_Ws }}"
      - name: "Generation Watts"
        device_class: power
        unit_of_measurement: "W"
        value_template: "{{ value_json.channels[3].p_W }}"
      - name: "Generation volts"
        device_class: voltage
        unit_of_measurement: "V"
        value_template: "{{ value_json.channels[3].v_V }}"
      - name: "Generationn Energy Imported"
        device_class: energy
        state_class: measurement
        unit_of_measurement: "Wh"
        value_template: "{{ value_json.channels[3].eImp_Ws }}"
      - name: "Generation Energy Exported"
        device_class: energy
        state_class: measurement
        unit_of_measurement: "Wh"
        value_template: "{{ value_json.channels[3].eExp_Ws }}"

The requirements for the energy dashboard are:

state_class: total_increasing
device_class: energy
unit_of_measurement: "kWh" # or Wh

Just changing the unit to Wh without converting from Ws will not work, you will be out by a factor of 3600.

e.g. try this:

      - name: "Consumption Energy Imported"
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: "Wh"
        value_template: "{{ value_json.channels[4].eImp_Ws|float(0) / 3600 }}"