s-allius / tsun-gen3-proxy

This proxy enables a reliable connection between TSUN third generation inverters (eg. TSOL MS600, MS800, MS2000) and an MQTT broker to integrate the inverter into typical home automations.
https://s-allius.github.io/tsun-gen3-proxy/
BSD 3-Clause "New" or "Revised" License
48 stars 6 forks source link

Auto Discovery does not connect to Home Assistant #71

Closed Pummelfisch closed 4 months ago

Pummelfisch commented 4 months ago

Sorry if I miss something obvious. I'm new to this tool and Home Assistant in general.

Problem

With my current configuration I am not able to find any hint of the proxy or the inverter (MS800) in Home Assistant, using docker.

Setup

I've deployed the stack according to the provided compose file here. I've adjusted the network name and the volumes, but nothing major. All three containers do start and dont report any error. The proxy is able to connect to mosquitto. I tried my best to configure the config.toml file:

# configuration to reach tsun cloud
tsun.enabled = true   # false: disables connecting to the tsun cloud, and avoids updates
tsun.host    = 'logger.talent-monitoring.com'
tsun.port    = 5005

# mqtt broker configuration
mqtt.host    = 'Mosquitto'   # URL or IP address of the mqtt broker
mqtt.port    = 1883
mqtt.user    = 'secure_username'
mqtt.passwd  = 'secure_password'

# home-assistant
ha.auto_conf_prefix = 'homeassistant'       # MQTT prefix for subscribing for homeassistant status updates
ha.discovery_prefix = 'homeassistant'       # MQTT prefix for discovery topic
ha.entity_prefix    = 'tsun'                # MQTT topic prefix for publishing inverter values
ha.proxy_node_id    = 'proxy'               # MQTT node id, for the proxy_node_id
ha.proxy_unique_id  = 'P170000000000001'    # MQTT unique id, to identify a proxy instance

# microinverters
inverters.allow_all = true   # allow inverters, even if we have no inverter mapping

# inverter mapping, maps a `serial_no* to a `mqtt_id` and defines an optional `suggested_place` for `home-assistant`
#
# for each inverter add a block starting with [inverters."<16-digit serial numbeer>"]
[inverters."inverter_id"]
node_id = 'wechselrichter'                 # Optional, MQTT replacement for inverters serial number
suggested_area = 'balkon'          # Optional, suggested installation area for home-assistant
pv1 = {type = 'PiE AIR superLIGHT Half-Cut 200+', manufacturer = 'PiE'}   # Optional, PV module descr
pv2 = {type = 'PiE AIR superLIGHT Half-Cut 200+', manufacturer = 'PiE'}   # Optional, PV module descr

I've removed any sensitive data like username and password aswell as the inverter id.

Also I have configured mosquitto with a config file, activating per_listener_settings and providing a password_file.

In the Home Assistant Web Interface I cant connect to the Proxy. Am I missing something or missconfigured anything?

Thank you in advance for the tool in general and any advise. If you need any furthor information, please let me know.

limes007 commented 4 months ago

With one of the recent updates I had to add some configuration settings for newer inverters, even though I don't have them.

Maybe you need this settings too.

# configuration to reach the new tsun cloud for G3 Plus inverters
solarman.enabled = false   # false: disables connecting to the tsun cloud, and avoids updates
solarman.host    = 'iot.talent-monitoring.com'
solarman.port    = 10000
Pummelfisch commented 4 months ago

Thank you for the idea. Actually I just removed those from the file, since i thought those where not necessary for me. Just re-added those lines but nothing changed.

s-allius commented 4 months ago

You can easily test the connection between Home Assistant and your proxy. Restart you Home-Assistant and you should see these lines in your proxy docker console:

'2024-05-14 21:50:14  INFO | mqtt | Home-Assistant Status: offline'
'2024-05-14 21:50:33  INFO | mqtt | Home-Assistant Status: online'
'2024-05-14 21:50:33  INFO | root | Initialize proxy device on home assistant'

That's because the proxy also listen on MQTT packets from home assistant. The third lines say, that the auto configuration was started. If you don't see this lines you have a problem with you MQTT configuration in HA or on your proxy...

Pummelfisch commented 4 months ago

I was able to add an mqtt instance by hand under the integrations page of home assistant. I assume that this is actually what i missed. Prior i just assumed that auto detect means that home assistant kind of suggests the proxy as a possibility. My missunderstanding sorry for that. Now I am able to se these exact three lines in in the proxy container.

Could you also tell me where i would be able to see if the inverter is connected succesfully to the proxy, because at the moment there is no output in Home Assistant that i can see?

Pummelfisch commented 4 months ago

Also when I compare your Screenshot of Devices in HomeAssistant here with what I am able to see there is clearly something missing which makes me think that maybe something else ist not quite correct configured on my side. 2024-05-15T11:43:42,716493856+02:00

Pummelfisch commented 4 months ago

Ah I missed the DNS Rebind protection-part. Realy sorry for that. I'll close this issue and thank you for your time.

s-allius commented 4 months ago

Your are welcome