Solar Assistant setup with Mosquitto as Broker/Bridge not Changing settings

I am trying to get Solar Assistant integrated in Home Assistant so I can control a MPP Solar inverter.

I am using this guide…SolarAssistant MQTT output and Home Assistant broker setup with SolarAssistant and Adjusting solar settings from Home Assistant.

My /share/mosquitto/solar-assistant.conf file looks like this :-

connection SolarAssistant
address x.x.x.x
topic # in
topic solar_assistant/# out

It seems to be partially working and I can see the Inverter under “Intergrations”. And I can see most of the “Entities” with all the sensors with the correct values etc. However, there are a few key things that are not right :-

  1. I can’t seem to change any of the settings via Home Assistant as outlined here Adjusting solar settings from Home Assistant. When I change the responses with either “Allow Settings Changes” in Solar Assistant disabled or enabled, nothing happens, and the “Reponse” as always “Unknown”. It might be relevant to note, that I can change these setting using the following command on my PC and it seems to work, so I assume it is some issue with the whole Home Assistant broker/bridge configuration :-

mosquitto_pub -h x.x.x.x -t “solar_assistant/inverter_1/output_source_priority/set” -m “Utility first”

  1. If I click on the device in home assistant, I see a bunch of “Controls” that I asssume I am supposed to be able to set thing. But most of them are greyed out. “Charge Source Priority” and “Output Source Priority” are not greyed, and I can select options here, but nothing changes.

  2. In /config/home-assistant.log I have a bunch of messages constantly scrolling related to this, even when I am not trying to set anything. Eg :-

2022-10-19 12:26:02.743 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.battery_absorption_charge_voltage: ‘56.4’ (valid options: [48.0, 48.1, 48.2, 48.3, 48.4, 48.5, 48.6, 48.7, 48.8, 48.9, 49.0, 49.1, 49.2, 49.3, 49.4, 49.5, 49.6, 49.7, 49.8, 49.9, 50.0, 50.1, 50.2, 50.3, 50.4, 50.5, 50.6, 50.7, 50.8, 50.9, 51.0, 51.1, 51.2, 51.3, 51.4, 51.5, 51.6, 51.7, 51.8, 51.9, 52.0, 52.1, 52.2, 52.3, 52.4, 52.5, 52.6, 52.7, 52.8, 52.9, 53.0, 53.1, 53.2, 53.3, 53.4, 53.5, 53.6, 53.7, 53.8, 53.9, 54.0, 54.1, 54.2, 54.3, 54.4, 54.5, 54.6, 54.7, 54.8, 54.9, 55.0, 55.1, 55.2, 55.3, 55.4, 55.5, 55.6, 55.7, 55.8, 55.9, 56.0, 56.1, 56.2, 56.3, 56.4, 56.5, 56.6, 56.7, 56.8, 56.9, 57.0, 57.1, 57.2, 57.3, 57.4, 57.5, 57.6, 57.7, 57.8, 57.9, 58.0, 58.1, 58.2, 58.3, 58.4, 58.5, 58.6, 58.7, 58.8, 58.9, 59.0, 59.1, 59.2, 59.3, 59.4, 59.5, 59.6, 59.7, 59.8, 59.9, 60.0, 60.1, 60.2, 60.3, 60.4, 60.5, 60.6, 60.7, 60.8, 60.9, 61.0, 61.1, 61.2, 61.3, 61.4, 61.5, 61.6, 61.7, 61.8, 61.9, 62.0, 62.1, 62.2, 62.3, 62.4, 62.5, 62.6, 62.7, 62.8, 62.9, 63.0, 63.1, 63.2, 63.3, 63.4, 63.5, 63.6, 63.7, 63.8, 63.9, 64.0])
2022-10-19 12:26:02.751 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.to_grid_battery_voltage: ‘46.0’ (valid options: [44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0])
2022-10-19 12:26:02.756 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.battery_float_charge_voltage: ‘54.0’ (valid options: [48.0, 48.1, 48.2, 48.3, 48.4, 48.5, 48.6, 48.7, 48.8, 48.9, 49.0, 49.1, 49.2, 49.3, 49.4, 49.5, 49.6, 49.7, 49.8, 49.9, 50.0, 50.1, 50.2, 50.3, 50.4, 50.5, 50.6, 50.7, 50.8, 50.9, 51.0, 51.1, 51.2, 51.3, 51.4, 51.5, 51.6, 51.7, 51.8, 51.9, 52.0, 52.1, 52.2, 52.3, 52.4, 52.5, 52.6, 52.7, 52.8, 52.9, 53.0, 53.1, 53.2, 53.3, 53.4, 53.5, 53.6, 53.7, 53.8, 53.9, 54.0, 54.1, 54.2, 54.3, 54.4, 54.5, 54.6, 54.7, 54.8, 54.9, 55.0, 55.1, 55.2, 55.3, 55.4, 55.5, 55.6, 55.7, 55.8, 55.9, 56.0, 56.1, 56.2, 56.3, 56.4, 56.5, 56.6, 56.7, 56.8, 56.9, 57.0, 57.1, 57.2, 57.3, 57.4, 57.5, 57.6, 57.7, 57.8, 57.9, 58.0, 58.1, 58.2, 58.3, 58.4, 58.5, 58.6, 58.7, 58.8, 58.9, 59.0, 59.1, 59.2, 59.3, 59.4, 59.5, 59.6, 59.7, 59.8, 59.9, 60.0, 60.1, 60.2, 60.3, 60.4, 60.5, 60.6, 60.7, 60.8, 60.9, 61.0, 61.1, 61.2, 61.3, 61.4, 61.5, 61.6, 61.7, 61.8, 61.9, 62.0, 62.1, 62.2, 62.3, 62.4, 62.5, 62.6, 62.7, 62.8, 62.9, 63.0, 63.1, 63.2, 63.3, 63.4, 63.5, 63.6, 63.7, 63.8, 63.9, 64.0])
2022-10-19 12:26:02.761 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.shutdown_battery_voltage: ‘42.0’ (valid options: [40.0, 40.1, 40.2, 40.3, 40.4, 40.5, 40.6, 40.7, 40.8, 40.9, 41.0, 41.1, 41.2, 41.3, 41.4, 41.5, 41.6, 41.7, 41.8, 41.9, 42.0, 42.1, 42.2, 42.3, 42.4, 42.5, 42.6, 42.7, 42.8, 42.9, 43.0, 43.1, 43.2, 43.3, 43.4, 43.5, 43.6, 43.7, 43.8, 43.9, 44.0, 44.1, 44.2, 44.3, 44.4, 44.5, 44.6, 44.7, 44.8, 44.9, 45.0, 45.1, 45.2, 45.3, 45.4, 45.5, 45.6, 45.7, 45.8, 45.9, 46.0, 46.1, 46.2, 46.3, 46.4, 46.5, 46.6, 46.7, 46.8, 46.9, 47.0, 47.1, 47.2, 47.3, 47.4, 47.5, 47.6, 47.7, 47.8, 47.9, 48.0, 48.1, 48.2, 48.3, 48.4, 48.5, 48.6, 48.7, 48.8, 48.9, 49.0, 49.1, 49.2, 49.3, 49.4, 49.5, 49.6, 49.7, 49.8, 49.9, 50.0, 50.1, 50.2, 50.3, 50.4, 50.5, 50.6, 50.7, 50.8, 50.9, 51.0, 51.1, 51.2, 51.3, 51.4, 51.5, 51.6, 51.7, 51.8, 51.9, 52.0, 52.1, 52.2, 52.3, 52.4, 52.5, 52.6, 52.7, 52.8, 52.9, 53.0, 53.1, 53.2, 53.3, 53.4, 53.5, 53.6, 53.7, 53.8, 53.9, 54.0])
2022-10-19 12:26:02.767 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.back_to_battery_voltage: ‘54.0’ (valid options: [0.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0, 64.0])

Does anyone have any idea how to resolve this issue. Thanks in advance.

Further to the post above, I found some more log messages in the error log which I am hoping with be insightfuk for someone to address the issue. I am getting this message about every minute :-

2022-10-19 13:25:27.203 ERROR (MainThread) [homeassistant.util.logging] Exception in async_discover when dispatching ‘mqtt_discovery_new_sensor_mqtt’: ({‘device’: {‘identifiers’: [‘sa_inverter’], ‘model’: ‘Axpert MKS I/II’, ‘manufacturer’: ‘Voltronic’, ‘name’: ‘Axpert MKS I/II’}, ‘name’: ‘Device mode’, ‘state_topic’: ‘solar_assistant/inverter_1/device_mode/state’, ‘unique_id’: ‘inverter_1_device_mode’, ‘unit_of_measurement’: None, ‘platform’: ‘mqtt’},)
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py”, line 315, in async_discover
config = discovery_schema(discovery_payload)
File “/usr/local/lib/python3.10/site-packages/voluptuous/validators.py”, line 232, in call
return self._exec((Schema(val) for val in self.validators), v)
File “/usr/local/lib/python3.10/site-packages/voluptuous/validators.py”, line 355, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File “/usr/local/lib/python3.10/site-packages/voluptuous/validators.py”, line 351, in _exec
v = func(v)
File “/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py”, line 272, in call
return self._compiled(, data)
File “/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py”, line 818, in validate_callable
return schema(data)
File “/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py”, line 272, in call
return self._compiled(, data)
File “/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py”, line 595, in validate_dict
return base_validate(path, iteritems(data), out)
File “/usr/local/lib/python3.10/site-packages/voluptuous/schema_builder.py”, line 433, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: string value is None for dictionary value @ data[‘unit_of_measurement’]

I am guessing something is not quite properly defined somewhere. But I need someone with greater insights than me to identify. Thanks heaps.

Error in post 2.
That seems to be bouncing off discovery.
I don’t think discovery takes nulls or none. It usually bounces when I try it for other things. That seems like an odd error though because it should be the integration sending that via a config message. So perhaps something has changed in the integration…

If they are greyed out it usually means they have received a config message but not a state message to update the value.

The link you posted talks about changing the items via a lovelace/dashboard entities card, not at the devices page.

Any ideas on how and where to go to get this fixed?

Yes, I have created the entity card, and it does not work, and the response stays as Unknown. I only mentions what is under the device, as the screenshot looks a little different to the documentation, and it was maybe interesting and a clue about the issue.

SolarAssistant is who would need to fix that missing unit error.

Although you could just poke around with mqtt explorer and resend that config message without the unit key and value.

‘unit_of_measurement’: None,       <<< remove this part and resend the message(copy paste send)

So if you check the retained messages in mqtt explorer you should see a message like

{‘device’: {‘identifiers’: [‘sa_inverter’], ‘model’: ‘Axpert MKS I/II’, ‘manufacturer’: ‘Voltronic’, ‘name’: ‘Axpert MKS I/II’}, ‘name’: ‘Device mode’, ‘state_topic’: ‘solar_assistant/inverter_1/device_mode/state’, ‘unique_id’: ‘inverter_1_device_mode’, ‘unit_of_measurement’: None, ‘platform’: ‘mqtt’}

change to this using the same topic it was originally sent with.

{‘device’: {‘identifiers’: [‘sa_inverter’], ‘model’: ‘Axpert MKS I/II’, ‘manufacturer’: ‘Voltronic’, ‘name’: ‘Axpert MKS I/II’}, ‘name’: ‘Device mode’, ‘state_topic’: ‘solar_assistant/inverter_1/device_mode/state’, ‘unique_id’: ‘inverter_1_device_mode’, ‘platform’: ‘mqtt’}

Dear all
Any update to fix it?
I have the same problem.

Good news. I might be getting ahead of the curve, but Solar Assistant has fixed this in the latest beta. He has reached out to me for testing which I have done and confirmed the fix. So you can wait for that to be released, or if you are in a hurry, enroll to recieve the Beta.

Instructions for that are at :-
https://solar-assistant.io/help/updates/beta
and
https://solar-assistant.io/help/updates/changelog

I assume that will fix it for you.

1 Like

Even with the beta I’m having similar problems from time to time.

In my case, I have multiple charge maps defined depending on the forecasted solar generation foe the day. This sets work mode targets and whether to charge from grid. This means, I change two settings for each slot every time I apply it.

I saw that doing it as fast as HA can in an automation would cause some settings not to be applied. I have since introduced an artificial delay of 5 sec after setting each setting.

I haven’t seen an issue when applying a single change. It just sometimes take a few seconds to reflect. This might not even be an SA issue, but an MQTT bridge issue. I haven’t investigated this further.

Also, why are you running a beta if issues are going to bother you? Stick with a stable release and report beta issues directly to them.

I have something similar.

I have HA controlling a Growatt SPH inverter via Solar Assistant. Using Node Red and a function to change the mode according to Octopus Agile price and Growatt state of charge. But get a error when outputting to the entity. It works most of the time even with the error reported but then screws up occasionally.

trying to use domain ‘select’ ‘select option’ function

I get an “Call-service error. Option Load first not valid for select.backup_eps” error even when it works

Screen Shot 2023-12-26 at 16.06.28

payload is ‘Battery first’ etc

controlling the ‘grid first charge slot’ works ok using a domain ‘home assistant’ ‘turn on/off’ function

what does everyone else use to control the SA?

But agree you need a 5 second delay between each post to SA

Screen Shot 2023-12-26 at 16.05.39