https://github.com/daniel-jong/esp8266_p1meter
- Mosquitto broker
- Add P1Reader to wifi and MQTT
Follow these steps to get the add-on installed on your system:
- Navigate in your Home Assistant frontend to Settings -> Add-ons -> Add-on store.
- Find the "Mosquitto broker" add-on and click it.
- Click on the "INSTALL" button.
The add-on has a couple of options available. To get the add-on running:
- Start the add-on.
- Have some patience and wait a couple of minutes.
- Check the add-on log output to see the result.
Create a new user for MQTT via your Home Assistant's frontend Settings -> People -> Users , (i.e. not on Mosquitto's Configuration tab). Notes:
- This name cannot be
homeassistantoraddons, those are reserved usernames. - If you do not see the option to create a new user, ensure that Advanced Mode is enabled in your Home Assistant profile.
To use the Mosquitto as a broker, go to the integration page and install the configuration with one click:
- Navigate in your Home Assistant frontend to Settings -> Devices & Services -> Integrations.
- MQTT should appear as a discovered integration at the top of the page
- Select it and check the box to enable MQTT discovery if desired, and hit submit.
- When your P1Reader starts up, it sets it up in Station mode and tries to connect to a previously saved Access Point.
- if this is unsuccessful (or no previous network saved) it moves the P1Reader into Access Point mode and spins up a DNS and WebServer (default ip 192.168.4.1).
- using any wifi enabled device with a browser (computer, phone, tablet) connect to the newly created Access Point.
- because of the Captive Portal and the DNS server you will either get a 'Join to network' type of popup or get any domain you try to access redirected to the configuration portal.
- choose one of the access points scanned, enter password also add the user we made in Mosquitto broker then click save.
- P1Reader will try to connect. If successful, it relinquishes control back to your app. If not, reconnect to AP and reconfigure.
- To reset wifi config on the P1Reader and set it back to Access Point double press the the reset button on the P1Reader.