sermatec-opensource / homeassistant-sermatec-inverter Goto Github PK
View Code? Open in Web Editor NEWHome Assistant custom component for the Sermatec solar inverter.
License: MIT License
Home Assistant custom component for the Sermatec solar inverter.
License: MIT License
Sensor names should be loaded from translation json files - now they are hard-coded and users have to rename the sensors manually, which I found very annoying :D. This issue consists of three tasks:
sensor.py
to load sensor names from the translations.This should help: hass docs
This will require:
Is it possible to add the inverter temperature as sensor?
After updating Home Assistant Core to version 2023.5.2, there is an issue with the meters and the Riemann Integral Sum Sensor integration that retrieve states from the Sermatec integration. It seems that with zero input state, the meters and sensors are always unavailable at some time. I don't know if this is a bug in Home Assistant, or if the latest modification to the Sermatec integration may somehow be causing this. If I downgrade Home Assistant Core to version 2023.4.6, everything is fine. Can you please take a look at this? Thank you. I am attaching the log.
Logger: homeassistant.helpers.template_entity
Source: helpers/template_entity.py:344
First occurred: 08:43:42 (6 occurrences)
Last logged: 08:49:34
TemplateError('ValueError: Template error: round got invalid input 'unavailable' when rendering template '{{ (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_battery_discharging_power') | round(0)) }}' but no default was specified') while processing template 'Template<template=({{ (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_battery_discharging_power') | round(0)) }}) renders=34>' for attribute '_attr_native_value' in entity 'sensor.battery_power'
TemplateError('ValueError: Template error: round got invalid input 'unavailable' when rendering template '{{ (states('sensor.solar_inverter_grid_import') | round(0)) + (states('sensor.solar_inverter_battery_discharging_power') | round(0)) + (states('sensor.solar_inverter_pv_total_power') | round(0)) - (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_grid_export') | round(0)) }}' but no default was specified') while processing template 'Template<template=({{ (states('sensor.solar_inverter_grid_import') | round(0)) + (states('sensor.solar_inverter_battery_discharging_power') | round(0)) + (states('sensor.solar_inverter_pv_total_power') | round(0)) - (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_grid_export') | round(0)) }}) renders=270>' for attribute '_attr_native_value' in entity 'sensor.okamzita_spotreba_domu'
TemplateError('ValueError: Template error: round got invalid input 'unavailable' when rendering template '{{ (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_battery_discharging_power') | round(0)) }}' but no default was specified') while processing template 'Template<template=({{ (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_battery_discharging_power') | round(0)) }}) renders=58>' for attribute '_attr_native_value' in entity 'sensor.battery_power'
TemplateError('ValueError: Template error: round got invalid input 'unavailable' when rendering template '{{ (states('sensor.solar_inverter_grid_import') | round(0)) + (states('sensor.solar_inverter_battery_discharging_power') | round(0)) + (states('sensor.solar_inverter_pv_total_power') | round(0)) - (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_grid_export') | round(0)) }}' but no default was specified') while processing template 'Template<template=({{ (states('sensor.solar_inverter_grid_import') | round(0)) + (states('sensor.solar_inverter_battery_discharging_power') | round(0)) + (states('sensor.solar_inverter_pv_total_power') | round(0)) - (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_grid_export') | round(0)) }}) renders=320>' for attribute '_attr_native_value' in entity 'sensor.okamzita_spotreba_domu'
TemplateError('ValueError: Template error: round got invalid input 'unavailable' when rendering template '{{ (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_battery_discharging_power') | round(0)) }}' but no default was specified') while processing template 'Template<template=({{ (states('sensor.solar_inverter_battery_charging_power') | round(0)) - (states('sensor.solar_inverter_battery_discharging_power') | round(0)) }}) renders=72>' for attribute '_attr_native_value' in entity 'sensor.battery_power'
The official app reports if the inverter works in on-grid mode, backup mode (off-grid)... A new sensor for this would be nice.
This method eliminates inconsistencies and "jumps" in the integrated values.
In the newest version the Home Assistant reports:
Entity sensor.solar_inverter_battery_temperature (<class 'custom_components.sermatec_inverter.sensor.SermatecSensor'>) is using native unit of measurement 'หC' which is not a valid unit for the device class ('temperature') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
Are there plans to extend the integration to control inverter operating modes?
After installing the Home Assistant Core Update 2023.5.0, the integration stops working. It does not load entities.
sermatec.py
should be included as a submodule in this repo or there should be links in the README.md
at least.
Edit: Or, ideally, the sermatec comm script should be loaded as a separate PyPI module.
Battery power is not calculated properly when the current is lower than 1 (floating type error = fix types, use float explicitly).
Hi,
Sometimes the inverter doesn't answer anymore, I propose to add a date time updated when we successfully have the inverter responding. Allowing us to detect when we're having trouble and then reload the integration and have data back again.
We should provide an example dashboard yaml config. Something like this.
Depends on #6.
Do not report Unavailable if other values could be retrieved. Now the integration gives up on every failure and waits for the next refresh. This should not happen.
This typically happens when there is more than one connection to the UART-TCP module (e.g. simultaneous connection from the official app).
Sometimes the integration would just stop updating the data and show only the last value (not Unavailable, which means the integration got stuck somehow).
See hassfest here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.