-
-
Notifications
You must be signed in to change notification settings - Fork 73
How to add to Home Assistant
AMS reader relies on MQTT to deliver data to Home Assistant. You need to either activate the Home Assistant internal MQTT broker or use a separate broker like Mosquitto. If you don’t already have an MQTT broker connected to your Home Assistant installation, refer to the Home Assistant documentation for more information. Do some testing to verify that it works before proceeding.
Navigate to the configuration page on the AMS reader and locate the MQTT configuration tile. Enter the connection information for your MQTT broker. If authentication is enabled on your broker, insert the username and password. If no authentication is configured, leave these fields blank. Set a client ID that is unique among all the devices connected to your MQTT broker. Then, select “Home Assistant” from the “Payload” dropdown and enter a publish topic where the data should be published. This can NOT be “homeassistant”, but should be something else.
Upon selecting “Home Assistant” as the payload, another tile with advanced configuration options will appear. Normally, no changes are needed for these fields. However, if you know what you’re doing, you can modify them.
- Discovery topic prefix: Use this if your Home Assistant listens to a different topic for discovery and status.
- Hostname for URL: Use this if you want a different hostname to reach this AMS reader.
- Name tag: Use this if you want to add a name tag to all the sensor names. This is useful if you have multiple AMS readers connected to the same Home Assistant.
After saving the changes (blue button in bottom right corner), the MQTT indicator in the header of the AMS reader GUI should turn green.
After successfully configuring your AMS reader, the device should now be available in Home Assistant under "Devices":
The available sensors will be added as they are discovered by your AMS reader. In some cases, it could take an hour or two before all sensors are available in Home Assistant.
Once all your sensors have been discovered, you can configure Grid Consumption in your Energy Dashboard in Home Assistant. Navigate to Settings -> Dashboards -> Energy and select “Add consumption” under “Grid consumption”.
Select the “Accumulated active import” sensor as the “Consumed energy” sensor. Then, select “Use an entity with current price” and choose the “Price current hour” as the sensor.
Your Home Assistant installation is now configured to track your consumption. Go to the Energy Dashboard, where you should now see a message saying “There is no data to show”. Wait for the indicated amount of time to let data populate the graph.
After a while, data should start populating and displaying on your graph:
Please note that some meters (those delivering HAN-NVE payloads) only report accumulated counters once per hour, a few seconds after the hour has ended. This will unfortunately cause the data in the graph to be skewed by one hour.