MQTT Not connecting after assigning static ip to RPi

Homeassistant log is
2019-01-18 15:32:52 ERROR (Thread-2) [homeassistant.components.mqtt] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2019-01-18 15:32:57 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 350, in _async_add_entity
await entity.async_added_to_hass()
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/switch/mqtt.py”, line 112, in async_added_to_hass
await self._subscribe_topics()
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/switch/mqtt.py”, line 163, in _subscribe_topics
‘qos’: self._config.get(CONF_QOS)}})
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/subscription.py”, line 83, in async_subscribe_topics
await requested.resubscribe_if_necessary(hass, current)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/subscription.py”, line 44, in resubscribe_if_necessary
self.qos, self.encoding
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 312, in async_subscribe
topic, msg_callback, qos, encoding)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 694, in async_subscribe
await self._async_perform_subscription(topic, qos)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 729, in _async_perform_subscription
_raise_on_error(result)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 814, in _raise_on_error
‘Error talking to MQTT: {}’.format(mqtt.error_string(result_code)))
homeassistant.exceptions.HomeAssistantError: Error talking to MQTT: The client is not currently connected.

I was able to connect it yesterday, All I did today was assign a static IP address to my RaspberryPi. Anything I am missing?

Hassio?

Try restarting the mqtt broker from the addon page.

If that does not work try rebooting (not restarting) from the hassio / system page.

yes Hassio.
I now tried restarting mqtt and rebooting from system page. Still same error

2019-01-18 16:11:25 ERROR (Thread-2) [homeassistant.components.mqtt] Unable to connect to the MQTT broker: Connection Refused: not authorised.

Got it working now. Changed “anonymous”: true, in mqtt broker config and restarted everything.

That’s weird why it shouldnt be working otherwise.

Can anyone one throw some light on this issue?

Are you using the mqtt integration or do you still have a yaml config?