ned-kelly / docker-voltronic-homeassistant

Programmatically read data from your Voltronic, Axpert, Mppsolar PIP, Voltacon, Effekta etc Inverter and send it to Home Assistant via MQTT - Works with RS232 & USB!
GNU General Public License v3.0
257 stars 140 forks source link

All Detected Sensors Show as Unknown #94

Closed Boney35y closed 1 year ago

Boney35y commented 1 year ago

I have cloned the repo as per the readme. I have configured inverter.conf and mqtt.json and started the container with docker up -d.

I can see the MQTT Data being sent. Listen

But the sensors show unknown:

Unknown

I have tried older versions of HA but I get the same results. Can anyone advise what I am missing here?

Boney35y commented 1 year ago

OK I have resolved the issue:

image

The resolution was identified by Listen

The sensor was inverter_

in sources/invert-mqtt/mqtt-push.sh we have: MQTT_SERVER=cat /etc/inverter/mqtt.json | jq '.server' -r MQTT_PORT=cat /etc/inverter/mqtt.json | jq '.port' -r MQTT_TOPIC=cat /etc/inverter/mqtt.json | jq '.topic' -r MQTT_DEVICENAME=cat /etc/inverter/mqtt.json | jq '.devicename' -r MQTT_USERNAME=cat /etc/inverter/mqtt.json | jq '.username' -r MQTT_PASSWORD=cat /etc/inverter/mqtt.json | jq '.password' -r

and later on the mosquitto_pub function uses:

    -t "$MQTT_TOPIC/sensor/"$MQTT_DEVICENAME"_"$MQTT_SERIAL"/$1" \

To resolve this I added:

MQTT_SERIAL=`cat /etc/inverter/mqtt.json | jq '.serial' -r`

Rebuilt the image and started and data started coming back in