ryanwinter/hass-rainforest-emu-2

Current period usage does not handle negative

Closed this issue · 4 comments

With solar panels this should be able to handle negative numbers.
image

Usage:
image

Hi,

Can you try out v1.1.3 to see if this has fixed the issue? I have used the same negative logic for the instantaneous usage.

If you don't see any changes, could you turn on logging for the component and you should see logs relating to the data returned from the device which may give additional hints on how to interpret negative results by editing your configuration.yaml.

logger:
  logs:
    custom_components.rainforest_emu_2: debug

Hi @TravHayes,

Were you able to have any success here?

@ryanwinter - Hi thanks for looking into this. I tried upgrading to the latest version and it didn't fix the issue. Here is debug from the current period that is during solar usage.

2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <CurrentPeriodUsage>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <DeviceMacId></DeviceMacId>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <MeterMacId></MeterMacId>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <TimeStamp>0xffffffff</TimeStamp>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <CurrentUsage>0x0000000000153d85</CurrentUsage>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <Multiplier>0x00000001</Multiplier>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <Divisor>0x000003e8</Divisor>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <DigitsRight>0x01</DigitsRight>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <DigitsLeft>0x00</DigitsLeft>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <SuppressLeadingZero>Y</SuppressLeadingZero>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received <StartDate>0x297331fe</StartDate>
2022-04-24 12:10:29 DEBUG (MainThread) [custom_components.rainforest_emu_2.emu2] received </CurrentPeriodUsage>

Looks like the currentperiodusage doesn't report on the received and delivered summation. The seperate cummulative sensors should be working now.