#Eyedro Home Energy Monitor integration

1 messages · Page 1 of 1 (latest)

steady mesa
#

Hi! New to Home Assistant, looking to integrate my Eyedro energy meter (small device with a CT on each of the two legs feeding my panel). It reports data on a local httpd as a json with a single array and as a web page that appears to be updating in realtime via AJAX.

Example json array (responds on http://eyedrohost:8080/getdata):

{"data":[[998,12436,7800,968],[956,12437,4520,537]]}

I see that there's Rest, Scrape, and HACS multiscrape but it isn't clear to me which of those I should use and how I would be able to extract the data from that array to individual items. Can I use a value_template of {{ value_json.data[1][0]/1000 }} for power factor for example?

The array format appears to be (spaced for readability):

"data": [
[Leg A Power Factor * 1000, Leg A Voltage * 100, Leg A Current * 1000, Leg A Power],
[Leg B Power Factor * 1000, Leg B Voltage * 100, Leg B Current * 1000, Leg B Power]
]
}```

(Web page example image attached, responds on ``http://eyedrohost:8080/dashboard`` and pulls that same json from ``/getdata``, every 2000ms, replacing html td elements inner html with data[x][y] divided as appropriate on each)

I'm thinking multiscrape might be the way to go so it's one http get per refresh (if I understand that all correctly), with something like this? (scan interval of 20s, would reduce it to the 2s if it works)

```js
multiscrape:
  - name: 'Multiscrape EYEdro Power Meter'
    resource_template: 'http://eyedrohost:8080/getdata'
    scan_interval: 20000
    log_response: true
    device_class: 'energy'
    sensor:
      - unique_id: multiscrape_eyedro_power_A_PF
        name: 'Multiscrape EYEdro Power Meter A Power Factor'
        value_template: '{{ value_json.data[1][0]/1000 }}'
      - unique_id: multiscrape_eyedro_power_A_V
        name: 'Multiscrape EYEdro Power Meter A Voltage'
        value_template: '{{ value_json.data[1][1]/100 }}'
      - unique_id: multiscrape_eyedro_power_A_I
        name: 'Multiscrape EYEdro Power Meter A Current'
        value_template: '{{ value_json.data[1][2]/1000 }}'
      - unique_id: multiscrape_eyedro_power_A_P
        name: 'Multiscrape EYEdro Power Meter A Power'
        value_template: '{{ value_json.data[1][3] }}'
      - unique_id: multiscrape_eyedro_power_B_PF
        name: 'Multiscrape EYEdro Power Meter B Power Factor'
        value_template: '{{ value_json.data[1][0]/1000 }}'
      - unique_id: multiscrape_eyedro_power_B_V
        name: 'Multiscrape EYEdro Power Meter B Voltage'
        value_template: '{{ value_json.data[1][1]/100 }}'
      - unique_id: multiscrape_eyedro_power_B_I
        name: 'Multiscrape EYEdro Power Meter B Current'
        value_template: '{{ value_json.data[1][2]/1000 }}'
      - unique_id: multiscrape_eyedro_power_B_P
        name: 'Multiscrape EYEdro Power Meter B Power'
        value_template: '{{ value_json.data[1][3] }}'

Am I on the right track? Is multiscrape the best way? Do I have device_class in the right spot? What else am I missing? (I don't know what I don't know but I'm sure there's plenty!)

Thank you!

steady mesa
#

Ok, so I loaded multiscraper and added this to the configuration.yaml:

multiscrape:
  - name: 'Multiscrape EYEdro Power Meter'
    resource: 'http://eyedrohost:8080/getdata'
    method: 'POST'
    scan_interval: 20000
    log_response: true
    sensor:
      - unique_id: multiscrape_eyedro_power_A_PF
        device_class: 'energy'
        state_class: 'measurement'
        name: 'Multiscrape EYEdro Power Meter A Power Factor'
        value_template: '{{ value_json.data[0][0]/1000 }}'
        unit_of_measurement: '%'
      - unique_id: multiscrape_eyedro_power_A_V
        device_class: 'energy'
        state_class: 'measurement'
        name: 'Multiscrape EYEdro Power Meter A Voltage'
        value_template: '{{ value_json.data[0][1]/100 }}'
        unit_of_measurement: 'V'
      - unique_id: multiscrape_eyedro_power_A_I
        device_class: 'energy'
        state_class: 'measurement'
        name: 'Multiscrape EYEdro Power Meter A Current'
        value_template: '{{ value_json.data[0][2]/1000 }}'
        unit_of_measurement: 'A'
      - unique_id: multiscrape_eyedro_power_A_P
        device_class: 'energy'
        state_class: 'measurement'
        name: 'Multiscrape EYEdro Power Meter A Power'
        value_template: '{{ value_json.data[0][3] }}'
        unit_of_measurement: 'W'
      - unique_id: multiscrape_eyedro_power_B_PF
        device_class: 'energy'
        state_class: 'measurement'
        name: 'Multiscrape EYEdro Power Meter B Power Factor'
        value_template: '{{ value_json.data[1][0]/1000 }}'
        unit_of_measurement: '%'
      - unique_id: multiscrape_eyedro_power_B_V
        device_class: 'energy'
        state_class: 'measurement'
        name: 'Multiscrape EYEdro Power Meter B Voltage'
        value_template: '{{ value_json.data[1][1]/100 }}'
        unit_of_measurement: 'V'
      - unique_id: multiscrape_eyedro_power_B_I
        device_class: 'energy'
        state_class: 'measurement'
        name: 'Multiscrape EYEdro Power Meter B Current'
        value_template: '{{ value_json.data[1][2]/1000 }}'
        unit_of_measurement: 'A'
      - unique_id: multiscrape_eyedro_power_B_P
        device_class: 'energy'
        state_class: 'measurement'
        name: 'Multiscrape EYEdro Power Meter B Power'
        value_template: '{{ value_json.data[1][3] }}'
        unit_of_measurement: 'W'

How do I tell that I'm getting values? I see the multiscrape log shows the json reply expected. Also I realize this reports W not Wh and Energy wants kWh, can I integrate over time inside HA for (k)Wh?

steady mesa
#

Figured that out. Looks like my scan interval was way too high.

#

What unit is scan_interval? Can I sum the two legs and integrate over time inside HA for estimated (k)Wh?

steady mesa
#

It appears to be seconds. I was able to add Integral Sensor helpers and Combine (sum) helper to generate the Wh for energy. It appears to be working but will be a few days before I have good numbers to compare.