Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95419

Data based on other data

$
0
0

@vb216 wrote:

Hi All,

Found I can push a rest request to smartthings, to get kwh readings for my electricity. I’m just taking a sample every 30s and pushing the new value over MQTT into HA.

What would be nice, is to do some maths on that value, essentially to calculate the change in kwh from the previous reading, time since the last reading, and to then calculate current watts used.

I potentially do it in the bash script that fires off the rest request to smartthings and pushes the result to MQTT, but I’m curious if its possible to do natively in HA? Would it be a template sensor with some maths behind it? But would that be able to pull the last historical reading as well?

Or, am I better putting a small Python/Java wrapper around it and do the logic externally to HA?
Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95419

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>