cyberjunky / home-assistant-custom-components

My custom components for Home Assistant
MIT License
71 stars 19 forks source link

Gas Used Last hour not correct. #7

Closed Fietspomp86 closed 5 years ago

Fietspomp86 commented 6 years ago

I noticed in HASS my GasUsed last hour was quite high, inspected the code and found this:

toon_smartmeter.py

if self.type == 'gasused':
if 'dev_3.1' in energy:
self._state = float(energy["dev_3.1"]["CurrentGasFlow"])/100
elif 'dev_2.1' in energy:
self._state` = float(energy["dev_2.1"]["CurrentGasFlow"])/100

If I look in my Toon the CurrentGasFlow is measured in liter, "CurrentGasFlow": "3345.00" Which shows 3345 liter on my Toon, so it should be /1000 right?

I wasn't sure if you'd like me to open a pull request hence the opening of the issue.

RudolfRendier commented 5 years ago

I think it should be 'L/h' (liter per hour), at least for my (analog) sensor.

http://toon:10080/hdrv_zwave/?action=getDevices.json

Gas: Huidig vermogen : xxx l/h

It's an indication of the current flow, and /1000 as suggested will probably convert it from L/h to m3/h.

Fietspomp86 commented 5 years ago

I think it should be 'L/h' (liter per hour), at least for my (analog) sensor.

http://toon:10080/hdrv_zwave/?action=getDevices.json

Gas: Huidig vermogen : xxx l/h

It's an indication of the current flow, and /1000 as suggested will probably convert it from L/h to m3/h.

Yes indeed, and the sensor shows m3/h, so that's why it should be /1000. Or you can remove the /1000 and make it L/h.

Anyway /100 is wrong :-)

cyberjunky commented 5 years ago

It fixed in code /1000