rlindner / node-red-contrib-sma-webconnect

Node-RED node to query the web interface of SMA inverters
MIT License
13 stars 9 forks source link

DC-values A and B and status #12

Closed aarondedecker closed 3 years ago

aarondedecker commented 3 years ago

Hi,

The modification of the payload for another module of inverter is not so difficult. These value_ids are working for me:

"values": { "6100_40263F00": { "name": "power", "divider": 1 }, "6100_00464800": { "name": "Voltage_N_L1", "divider": 100 }, "6100_00464900": { "name": "Voltage_N_L2", "divider": 100 }, "6100_00464A00": { "name": "Voltage_N_L3", "divider": 100 }, "6100_00465700": { "name": "Grid_freq", "divider": 100 }, "6100_00464B00": { "name":"Voltage_L1_L2", "divider": 100 }, "6100_00464C00": { "name":"Voltage_L2_L3", "divider": 100 }, "6100_00464D00": { "name":"Voltage_L3_L1", "divider": 100 }, "6400_0046C300": { "name": "Wh_counter", "divider": 1 } }

But when I want to get the values on the DC-side, I only get the B-value. This is probably because the value_id does respond with an array of A and B. How can I get both values? Secondly, I want to get also the status (Ok or Not Ok) but when I try with the found value_id, I only get a tag as repons. Is there a work around here?

Thanks in advance!

HoLo85 commented 3 years ago

Please always provide the model of inverter you are using if you post a basic payload config.

What values are you trying to read and could you provide an example message from the webinterface. If the read message contains an array you should be able to access it as such.

For OK/NOK you have to map the tags in Node-RED to the corresponding state, for example with a change or function block. The SMA webinterface does the same so you have to figure out what tag is which state.

aarondedecker commented 3 years ago

My model is the SUNNY TRIPOWER 3.0 (STP3.0-3AV-40).

These values I'm trying to read: image

The value_id is for eg. Power [A] = 6380_40251E00_0 and for Power [B] = 6380_40251E00_1. These values_ids gives 0 as results. When I delete the last 2 digits, so for 6380_40251E00, the value is the one from Power [B]. I suspect we need an array selector to read out A?

The OK/NOK makes sense, but where does the webinterface changes the tag to the corresponding state? At the moment the inverter is OK, so I read tag 307. Probably other tags than 307 are NOK, but I want to make sure.

rlindner commented 3 years ago

Hey @aarondedecker,

just a short explanation to your second question about the tags:

The OK/NOK makes sense, but where does the webinterface changes the tag to the corresponding state? At the moment the inverter is OK, so I read tag 307. Probably other tags than 307 are NOK, but I want to make sure.

Those tags are translation ids, you can retrieve the translations from the inverters webinterface on the following path/data/l10n/en-US.json. You then just need to find out the possible values.

aarondedecker commented 3 years ago

Hey Roland,

I see but that's a long list :) maybe I will stick with 307 = OK, other NOK. Thanks for the code and sharing it!

HoLo85 commented 3 years ago

Hi, a quick response to your value problem.

When I extended @rlindner code I added a simple array detection for the messages, but instead of saving the complete message i only save the first value of the array. I will have a look into it at the weekend during the day when solar cell are generating power.

HoLo85 commented 3 years ago

OK, should be fixed with the next update if @rlindner approves the PR.

rlindner commented 3 years ago

I've just released v0.2.0 containing the changes.

HoLo85 commented 3 years ago

@aarondedecker were you able to test the new version and does it work for you now?

HoLo85 commented 3 years ago

@rlindner since there has been no answer from @aarondedecker I suggest we close this issue.