britkat1980 / giv_tcp

TCP connection (from inverter) and MQTT implementation
71 stars 32 forks source link

Unable to set battery reserve - Hybrid Gen3 #187

Open Sc0th opened 1 month ago

Sc0th commented 1 month ago

Hi,

Using docker version britkat/giv_tcp-ma:latest

I am unable to set the battery reserve, is this a bug or am I doing it wrong?

[INF] infra01:~# mosquitto_sub -h mqtt -t solar//Control/# -v | ts | grep -i reserve May 17 13:00:30 solar/myserial/Control/Battery_Power_Reserve 50 May 17 13:00:33 solar/myserial/Control/setBatteryReserve {reservePercent:15} May 17 13:00:50 solar/myserial/Control/Battery_Power_Reserve 50

I am sending the following

mosquitto_pub -h mqtt -t solar/myserial/control/setBatteryReserve -m {\"reservePercent\":\"15\"}

I see nothing related in the debug logs which suggests to me I maybe sending garbage, any advice would be appreciated.

GIV-HY5.0 - D0.308-A0.308

Cheers!

britkat1980 commented 1 month ago

when sending a command its on the following topic: GivEnergy/control// (assuming you've changed the GivEnergy Topic to Solar)

control comes first, rather than myserial

Sc0th commented 4 weeks ago

Thanks for getting back to me, just tried this:

mosquitto_pub -h mqtt -t solar/control/myserial/setBatteryReserve -m {"reservePercent":"15"}

It's still not playing, fails with

2024-06-02 17:21:27,945 - Inv1 - mqtt_client - [DEBUG ] - MQTT Message Recieved: solar/control/myserial/setBatteryReserve= {reservePercent:15} 2024-06-02 17:21:27,946 - Inv1 - mqtt_client - [ERROR ] - MQTT.OnMessage Exception: (<class 'ValueError'>, ValueError("invalid literal for int() with base 10: '{reservePercent:15}'"), <traceback object at 0x7f40bcd68780>)

Sc0th commented 4 weeks ago

ok, this works

mosquitto_pub -h mqtt -t solar/control/myserial/setBatteryReserve -m 15

Do the docs need a tweak or am I just interpreting them incorrectly?