Home Assistant via PVoutput

I’ve come across some buzz on the home assistant forum that talks about ways to get home energy data into HA. It appears there are configurations within HA to have it upload home energy data from many existing home energy monitor

Blockquote

devices. Those energy monitors typically upload their data to a proprietary cloud service, and the HA interface appears to simply query those cloud services for the data.

Now that PVoutput is supported, and it’s basically free, you can upload generation, consumption, and voltage data to PVoutput and setup HA to get the data from PVoutput. Not sure if there is a way to provide additional data streams to HA using the six additional live data fields available in donator mode. Maybe some HA users could explore this and post some more informed details.

Ill go one better.

Here is a Home Assistant config that integrates with IoTaWatt directly

With this you can access every input as well as outputs directly in HA.
:smile:

You can also configure how often you want it to update. The default config is every 5 seconds but every 60 should be plenty.

2 Likes

Is this basically screen scraping the IoTaWatt local web page?

I would like to have IoTaWatt make webHook calls to supply data to my Hubitat Elevation home automation platform. I was considering taking a look at how the InfluxDB service for IoTaWatt works, to see if it could be made more generic to allow IoTaWatt to push updates to my Home Automation Platform, instead of polling the data.

Does anyone have any thoughts?

My main use-case for this is to notify us when the Laundry Cycle is complete. I currently use a Z-Wave Energy Monitor paired to my Hubitat hub to do this. Now that I have IoTaWatt, this seems like a good test case for local integration with Hubitat. Assuminging I can get it working, I can then expand my thinking to see what other automations I can dream up. A simple one would be to notify my teanage son if his gaming computer has been left on for too long, as it consumes a lot of power. Maybe I could send him a monthly bill! :slight_smile:

It looks like @dotnetdan is telling Home Assistant how to parse the Json from the IoTaWatt status API. Several others have used the status API to harvest real-time data from IoTaWatt. The caveat is that the status values are damped, and so represent an average over time with diminishing significance. That’s probably better for the HA application, and any other real-time dashboards. It’s just not appropriate to try to build a time-series picture of usage. There are other feeds for that including the influx, emoncms and PVoutput services.

So now that PVoutput is in the can, I’m starting to think about how to integrate with these real-time dashboard and alert systems, of which there seem to be many.

The common denominator seems to be MQTT. My reluctance to add an MQTT feed earlier was that it is not a great way to deliver timestamped data. But for a real-time data feed, I think it can have value without getting into the complexity of the higher QOS levels. Just squirt out data asynchronously at regular intervals.

I’ll be looking into that soon.

7 Likes

Thanks for the feedback. Parsing JSON is fairly trivial within Hubitat, so I may give that method a try in the short term. MQTT is not natively supported by Hubitat, so it is a little less desirable to me, personally.

I would prefer a more event-based push of data, instead of polling the status page continuously. My real-time systems programming background has trained me to only send the data that has changed, when it changes. :wink:

Well… It’s ALWAYS changing, the question is whether the change is significant. That would need to be defined. At some point it then becomes an issue of whether there is less resource use and complexity to discriminate change than to just send it out and let the recipient decide. Sending out an asynchronous packet every 15 or thirty seconds is pretty low overhead.

I’d like to explore this more and get more feedback. Just thinking on my feet, I could see some form of generic Json (or other) output service. Possibly using something like printf formatting to generate a payload, or maybe there’s some generic Json generation syntax that you could point me at.

A service like that could deliver the payload using HTTP or MQTT, so it’s not either/or.

1 Like

I just ordered one iotawatt and will also be intetested in reading current power consumption from iobroker.

Im my opinion MQTT semms to be a good way to go. It is the technology of the moment.

As an alternative, I would suggest modbus tcp protocol. Modbus is an old protocol, but still widely available, especially within industrial equipment. It is some kind of small common denominator for interoperability. Almost every home automation software, scada system and machine controller can talk modbus. Thus it is still a pooling protocol.

hi, thank you very much, working everything but not the sensor from 10 to 14… am i missing something?
i get value 0 from sensor 10, but from iotawatt “status page” is working correctly

  - platform: template
sensors:
  iotawatt_1:
    friendly_name_template: 'Channel {{ states.sensor.iotawatt.attributes["inputs"][1].channel }}'
    unit_of_measurement: 'Watts'
    value_template: '{{ states.sensor.iotawatt.attributes["inputs"][1].Watts }}'
  iotawatt_2:
    friendly_name_template: 'Channel {{ states.sensor.iotawatt.attributes["inputs"][2].channel }}'
    unit_of_measurement: 'Watts'
    value_template: '{{ states.sensor.iotawatt.attributes["inputs"][2].Watts }}'
  iotawatt_10:
    friendly_name_template: 'Channel {{ states.sensor.iotawatt.attributes["inputs"][10].channel }}'
    unit_of_measurement: 'Watts'
    value_template: '{{ states.sensor.iotawatt.attributes["inputs"][10].Watts }}'

Value in bracket like [1] in HA value_template is not input or output channel of IoTaWatt but an order of JSON data array start from [0]. Normally we have input0 for Vref so input0 = [0] and input1 = [1]. However if you connect CT to input 1&2&10 and are not configure input 3-9, your data order will be [1] for input1, [2] for input2 BUT [3] for input10. Also on output side if you add new output in IoTaWatt you must check data order again since it will rearrange alphabetically. For example at first you add output_total it will be [0]. But when you add another output_misc, output_misc will become [0] and output_total will be shifted to [1] in JSON array.