davidusb-geek / emhass-add-on

The Home Assistant Add-on for EMHASS: Energy Management Optimization for Home Assistant
MIT License
96 stars 29 forks source link

PV production paid price field in UI config doesn't like to be touched #90

Closed HACS-bank closed 7 months ago

HACS-bank commented 7 months ago

version: 0.8.6

In my environment, the PV production exported to grid is not paid.

In the Config UI for the add on, the PV production paid price defaults to '0'. If I don't touch the field, all is well and I can save other changes.

However, if I change this field in any way, and then change it back to zero, the config cannot be saved. After trying to save, the field is altered to a value which is not valid.

Changing it back to zero doesn't resolve the problem as we are now in a loop.

Other changes to the configuration cannot be saved; the only way out is to leave the config UI and start over, repeating other changes but not touching this field.

HACS-bank commented 7 months ago

Using the up/down buttons: if I change to -1 and back to 0, attempted saving resets field to -1 and generates "can't save" error message. if I now change value to +5, attempted save brings up "restart EMHASS" dialog. Choose CANCEL and the field value is now +4 not +5.

Is this an "out-of-range integer, convert to float, convert back to display format" problem?

HACS-bank commented 7 months ago

False alarm: non-problem. The value seen in the field is always a multiple of -1 offset from the desired vale.

Error is due to scrolling the screen (to get to the SAVE button) using the mouse wheel. The scrolling action appears to also subtract 1 from the field value if the field is still selected.