Recently I acquired a sensor for the electricity meter. The sensor page is in PT, but is a tasmota that was adjusted to the meters used in Portugal.
It is connected through MQTT and I have the values in Home Assistant and the database:
There are mentions of similar issues, but all appear to fix themselves after one update or by changing the browser.
HomeAssistant is being deployed in an RPI4 with the following docker-compose:
And the configuration file for home assistant is the following:
# Loads default set of integrations. Do not remove.
default_config:
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
- ::1
- 192.168.1.0/24
recorder:
db_url: !secret mariadb
purge_keep_days: 10 # default
history:
influxdb:
api_version: 2
ssl: false
host: 127.0.0.1
port: 8086
token: !secret influxdb_token
organization: !secret influx_org
bucket: homeassistant
tags:
source: HomeAssistant
tags_attributes:
- friendly_name
default_measurement: units
ignore_attributes:
- icon
exclude: # Customise to fit your needs
entities:
- zone.home
domains:
- persistent_notification
- person
Since the sensor values are in the database, I don’t think the issue is in the deployment.
I also have no errors in the logs, nor issues in the statistics dev menu.
The sensor read a value every 5 minutes.
The jumps are mostly 5 minutes apart.
There are some jumps of 10 minutes.
Can try to improve the WiFi connection to the device.
The developer from the sensor (EasyHan) helped track some bugs and we fixed them.
There were some improvements in the connectivity and resolution.
However, the main issues still remain.
The strangest part is that on the MQTT side the meter sends updates periodically (every couple of seconds):
There are several values on the Mosquitto Broker that are not displayed on HA.
One issue may be the absolute value, in most cases the value published is similar or as a difference of 0.001 unit.
Thanks for the suggestion, I already tried without the influxdb database.
However, the problem still exists.
There are some strange messages on the MQTT logs (after activating the debug option)
> 2023-08-11 09:57:06.515 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '{"Time":"2023-08-11T09:58:17","EB1":{"CH":9,"CM":58,"CS":15,"VL1":233.5,"Current":1.3,"TEI":17002.821,"TEE":0.000,"TET1":4842.038,"TET2":4036.091,"TET3":8124.692,"Power":137,"APE":0,"Factor":0.455,"Frequency":50.0,"Tariff":3,"CT1":4.60,"CT4":4.60,"LP1_Y":2023,"LP1_M":8,"LP1_D":11,"LP1_HH":9,"LP1_MM":45,"LP3_IMP":0.056},"HAN":{"s0":0.056,"s1":5.015,"s2":0.000,"ck":"09:58:15"}}' with variables {'entity_id': 'sensor.eb1_export', 'name': 'Export', 'this': <template TemplateStateFromEntityId(sensor.eb1_export)>} with default value 'default' and Template<template=({% set x = value_json.EB1.TEE|float(0) %} {% if x > 0 %} {{ x }} {% endif %}) renders=4967>
> 2023-08-11 09:57:06.515 DEBUG (MainThread) [homeassistant.components.mqtt.sensor] Ignore empty state from 'tele/edpbox1/SENSOR'
Let us focus on the missing energy column from 10 to 11, as seen in images 2 and 3 there are values on the recorder to make the energy estimation. I computed the difference and from 10h to 11h the energy consumption is 0.55 and from 11h to 12h the energy consumption is 0.52. adding both values together we get 1.07 which is the value of the column in 11h to 12h.
Bellow there is an image of the consumption measured from 10h to 12h.
The problem is not missing data, but just missing columns, from some reason the energy display merges some columns.
What are the requirements for these columns?
There is a minimal number of points per hour? Given the low consumption that I am reading maybe there are not enough points (distinct points, EasyHan sensor sends data every 10 seconds).
Requires data on the hour (meaning a data point at 10,11,12)?
Any other requirements?
Can I create a virtual sensor that uses linear interpolation to fix the gaps and allows the energy display to properly draw all columns?