and it returns (into HA) number 17 it means 0x0011 in HEX which means it is CHARGING (descibed in the PDF). How can I translate this into “charging” state in HA?
it returns value 17 (mostly), also 34 and 51. It means charge, discharge, standby. Value 17 is translated from 0x0011 hexadecimal.
template is configured as:
- name: "Battery Status"
unique_id: battery_status
state: >
{% set x = states('sensor.test_1101_status')|int(0) %}
{% if x == "17" %}
{{ "Charging" }}
{% elif x == "34" %}
{{ "Discharging" }}
{% elif x == "51" %}
{{ "StandBy" }}
{% else %}
{{ "error" }}
{% endif %}
But the result of template shows error only. Maybe I should read 17 value in HEX by template? I tried 0x0011 but without success. Test 1101 status sensor output which I see in HA is just 17.
Hello, please could someone help me with this error? The system cannot restart because the configuration is not valid: Invalid config for [modbus]: extra keys not allowed @ data['modbus'][0]['host']. Got '192.168.10.10' extra keys not allowed @ data['modbus'][0]['scan_interval']. Got 10 not a valid value for dictionary value @ data['modbus'][0]['type']. Got 'tcp' required key not provided @ data['modbus'][0]['baudrate']. Got None required key not provided @ data['modbus'][0]['bytesize']. Got None required key not provided @ data['modbus'][0]['method']. Got None required key not provided @ data['modbus'][0]['parity']. Got None required key not provided @ data['modbus'][0]['stopbits']. Got None. (See /config/configuration.yaml, line 79).
There is no “modbus” word in modbus.yaml file
“modbus” word is only in configuration.yaml as modbus: !include modbus.yaml
Seems like something inside HASS regarding to modbus is corrupted. I updated to newest supervisor/hass but without success. Even if I set modbus TCP the error seems like it wants SERIAL configuration (baudrate, bytesize etc.). Just seems like there is some cache or something somewhere that prevents modbus service to read actual config…? It worked before (3 days ago) and I think I didn´t change anything.
Thank you for suggestion. But regarding the first register - it is not my config, it is from manufacturer table. How should look hass config for such register?
And regarding modbus service - how should look command?
Thank you.