Busch-Jaeger / node-free-at-home

4 stars 5 forks source link

EnergyOneWayMeterV2Device only does not allow decimal values #7

Open geri-m opened 11 months ago

geri-m commented 11 months ago

If you try to set a decimal value on a EnergyOneWayMeterV2Device

    energyMeter.setTotalEnergyExported("2222.1");

the follow error occurse

Uncaught Error UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "HTTP status code: 403Reason: ".
    at getErrorWithoutStack (node:internal/process/promises:321:15)
    at generateUnhandledRejectionError (node:internal/process/promises:341:15)
    at processPromiseRejections (node:internal/process/promises:287:24)
    at processTicksAndRejections (node:internal/process/task_queues:96:32)

I'm using "@busch-jaeger/free-at-home": "0.30.0".

ChristophKronberger commented 10 months ago

@geri-m You Got a HTTP response code 403, which means you dont have permissions to set the datapoint. Check the user you are using has the right permissions and try again.

geri-m commented 10 months ago

@ChristophKronberger thanks for the reply. I'm using the same user as for all other devices I want to create, but only for this one the error occurs. I'm using an "installer" user which was used to setup the whole free@home setup in my location. Any advice, what kind of permissions I should look out for?

ChristophKronberger commented 10 months ago

@geri-m Okay i think i see the issue. You are trying to set

0x04C9 | 1225 | AL_MEASURED_TOTAL_ENERGY_EXPORTED | DPT_ACTIVE_ENERGY_KWH

this datapoint represents total energy exported in Kwh.

According to the offical ABB docs :

For reading and writing datapoints the value is always encoded as string.

It also says that this datapoint has a 4 byte value, so assuming ASCII encoding you can pass 4 characters. Means you can pass a maximum value of 9999

So to clearify this is not an offical answer since im not familar with the api impl. on the SYSAP but maybe @StefanGuelland can confirm or deny

geri-m commented 9 months ago

@ChristophKronberger thanks for pointing to the doc. couldn't make it work. Just out of curiosity. I saw you weather Station plugin - I am experimenting with something similiar. Besides this, no other virtual device is/was working for me. Did you have any other experience?