catalinsanda / org.openhab.binding.solarman

Binding used to communicate with Solarman (IGEN-Tech) v5 based solar inverter data loggers
Eclipse Public License 2.0
9 stars 3 forks source link

Some values show NULL, some show 0 (Deye-SUN-2000G3-EU | deye_4mppt) #11

Closed bolausson closed 1 year ago

bolausson commented 1 year ago

Hello,

again, thanks for your efforts of bringing this binding to OpenHab!

Most of the currently gathered values are shown correct for my Deye-SUN-2000G3-EU (deye_4mppt), some values though are not gathered properly (or have another issue).

Total Production - Shows NULL whereas it should show somethig around 244 kWh image

Daily Production - Shows NULL, but it should show somethign aroun 0.5 kWh image

Running state is NULL - at the time of writing this, it is defenitely running :) image image

PV3 Current - is reported as NULL (No solar pannel attached) image

PV4 Current - is reported as 0 (again, no solar pannel attached). Why is this showing 0 when PV3 is showing NULL? image

Let me know if you need mor info to track down those issues :-)

Example for all values: image

catalinsanda commented 1 year ago

Hey, thanks for posting the issue.

I'll try to look into it over this weekend. In the meantime, if you have the time, can you post the debug logs? It will help me see what values are returned for the registers you get null or zero values.

To enable them issue a: log:set TRACE org.openhab.binding.solarman in the console.

Thanks, Catalin

bolausson commented 1 year ago

Hej Catalin,

thanks for the quick response!

the NULL issue might have been caused by myself:

Failed to update item 'DeyeSUN2000G3EU_PV3_Current' because '0 A' could not be converted to the item unit 'V'
Failed to update item 'DeyeSUN2000G3EU_Daily_Production' because '1 kWh' could not be converted to the item unit 'W'
Failed to update item 'DeyeSUN2000G3EU_Total_Production' because '246.1 kWh' could not be converted to the item unit 'W'

I changed PV3_Current from type Number:ElectricPotential to Number:ElectricCurrent --> Works now Daily_Production from type Number:Power to Number:Energy --> Should work (can't confirm yet as there is no sun) Total_Production from type Number:Power to Number:Energy --> Works now

I can't remember if I did this asignment initially wrong or if there is "default" which is being picked up when assigning a new item. Might as well be my fault :)

I tried to change Running_Status from type "switch" to type "string" and see if that yields anything interesting and indeed, it now returns: 1970-01-01T01:00:00.000+0100 This doesn't look right :)

What happens often is this: image

I have to go back to the thing and hit "Save" and then I can go back to the channels and see all the channels - not sure though if this is OpenHAB thing or specific to your binding.

Here are some the trace logs after all the above mentioned changes:

2023-07-27 10:56:02.981 [DEBUG] [arman.internal.SolarmanLoggerHandler] - Fetching data from logger
2023-07-27 10:56:02.999 [DEBUG] [rnal.modbus.SolarmanLoggerConnection] - Request frame: A5170010450000733AE6F602000000000000000000000000000001030003007E35EA9B15
2023-07-27 10:56:03.329 [DEBUG] [rnal.modbus.SolarmanLoggerConnection] - Response frame: A50F01101500ED733AE6F60201616173002C200000C1CF4E640103FC3232303832313233363900000000120C070000000126060300004E2
000000401004B0000003C17071B0A3415000000000ABE07081450128E000000000000139C002C0000000000000000006400000000000100000000000100000000000100000000000A0000000000000000000000000002000100000000099D00000000000
0000000000483000004990000093800000000000200000000138800000000000000000000000002300000000000000D52000000000000000000000000000000000000000000000000000000000000000000000000011E000901220009000000000000000
000000000000000000000000000000000000000000000000099822115
2023-07-27 10:57:02.981 [DEBUG] [arman.internal.SolarmanLoggerHandler] - Fetching data from logger
2023-07-27 10:57:02.991 [DEBUG] [rnal.modbus.SolarmanLoggerConnection] - Request frame: A5170010450000733AE6F602000000000000000000000000000001030003007E35EA9B15
2023-07-27 10:57:03.324 [DEBUG] [rnal.modbus.SolarmanLoggerConnection] - Response frame: A50F01101500EF733AE6F602019D61730068200000C1CF4E640103FC3232303832313233363900000000120C070000000126060300004E2
000000401004B0000003C17071B0A3415000000000ABE07081450128E000000000000139C002C0000000000000000006400000000000100000000000100000000000100000000000A0000000000000000000000000002000100000000099D00000000000
0000000000483000004990000092400000000000200000000139200000000000000000000000001FE0000000000000D660000000000000000000000000000000000000000000000000000000000000000000000000134000801480007000000000000000
000000000000000000000000000000000000000000000000059735C15
2023-07-27 10:58:02.981 [DEBUG] [arman.internal.SolarmanLoggerHandler] - Fetching data from logger
2023-07-27 10:58:02.991 [DEBUG] [rnal.modbus.SolarmanLoggerConnection] - Request frame: A5170010450000733AE6F602000000000000000000000000000001030003007E35EA9B15
2023-07-27 10:58:03.325 [DEBUG] [rnal.modbus.SolarmanLoggerConnection] - Response frame: A50F01101500F1733AE6F60201D9617300A4200000C1CF4E640103FC3232303832313233363900000000120C070000000126060300004E2
000000401004B0000003C17071B0A3919000000000ABE07081450128E000000000000139C002C0000000000000000006400000000000100000000000100000000000100000000000A0000000000000000000000000002000100000000099D00000000000
0000000000483000004990000092400000000000200000000139200000000000000000000000001FE0000000000000D660000000000000000000000000000000000000000000000000000000000000000000000000134000801480007000000000000000
000000000000000000000000000000000000000000000000084780F15

Cheers, Bjoern

catalinsanda commented 1 year ago

Looking at the definition:

- name: "Running Status"
        class: ""
        state_class: ""
        uom: ""
        scale: 1
        rule: 1
        registers: [0x003B]
        isstr: true
        lookup:
          - key: 0
            value: "Stand-by"
          - key: 1
            value: "Self-check"
          - key: 2
            value: "Normal"
          - key: 3
            value: "Warning"
          - key: 4
            value: "Fault"
        icon: 'mdi:home-lightning-bolt'

and parsing your logs, at register 0x003B you get:

[003B]: 0002 (2)

which is "Normal".

The binding doesn't map integer values to string yet using the lookup values. It's on the TODO list. In the meantime you can use a number instead of a string and use the Map transformation service: https://www.openhab.org/addons/transformations/map/

bolausson commented 1 year ago

Again, seems to be my mistake - Setting it to "number" works now!

Thanks! I'll do the mapping in Grafana :)

label: Running Status
type: Number
category: status
groupNames: []
groupType: None
function: null
tags:
  - Point

image

Greetings, Bjoern

catalinsanda commented 1 year ago

Glad it works, closing this.