Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State value too long for HA #542

Closed
leeyuentuen opened this issue Feb 21, 2022 · 4 comments
Closed

State value too long for HA #542

leeyuentuen opened this issue Feb 21, 2022 · 4 comments

Comments

@leeyuentuen
Copy link

leeyuentuen commented Feb 21, 2022

Description

When I use ebus on home assistant. It seems the state value is too long to let HA process them:

Exception in message_received when handling msg on 'ebusd/bai/SetMode': '{ "hcmode": {"value": "auto"}, "flowtempdesired": {"value": 28.0}, "hwctempdesired": {"value": 59.0}, "hwcflowtempdesired": {"value": null}, "disablehc": {"value": 0}, "disablehwctapping": {"value": 0}, "disablehwcload": {"value": 0}, "remoteControlHcPump": {"value": 0}, "releaseBackup": {"value": 0}, "releaseCooling": {"value": 0}}' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 42, in wrapper msg_callback(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/sensor.py", line 282, in message_received self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 663, in _async_write_ha_state self.hass.states.async_set( File "/usr/src/homeassistant/homeassistant/core.py", line 1357, in async_set state = State( File "/usr/src/homeassistant/homeassistant/core.py", line 1045, in __init__ raise InvalidStateError( homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.setmode. State max length is 255 characters.
> Exception in message_received when handling msg on 'ebusd/global/updatecheck': '"revision v22.1 available, broadcast.csv: different version available, memory.csv: different version available, vaillant/08.bai.csv: different version available, vaillant/bai.308523.inc: different version available, vaillant/broadcast.csv: different version available, vaillant/errors.inc: different version available, vaillant/general.csv: different version available, vaillant/hcmode.inc: different version available, vaillant/timerhc.inc: different version available"' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 42, in wrapper msg_callback(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/sensor.py", line 282, in message_received self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 663, in _async_write_ha_state self.hass.states.async_set( File "/usr/src/homeassistant/homeassistant/core.py", line 1357, in async_set state = State( File "/usr/src/homeassistant/homeassistant/core.py", line 1045, in __init__ raise InvalidStateError( homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.ebusd_updatecheck_2. State max length is 255 characters.
@leeyuentuen leeyuentuen changed the title State value too long State value too long for HA Feb 21, 2022
@john30
Copy link
Owner

john30 commented Feb 26, 2022

that seems to be a limitation on HA side, could be circumvented by cutting long strings down

@Koky05
Copy link

Koky05 commented Mar 29, 2022

I insert after HA restart new config for updatecheck:
{ "unique_id": "ebusd_global_updatecheck", "device": { "identifiers": "ebusd", "manufacturer": "ebusd.eu", "name": "ebusd", "sw_version": "22.2", "suggested_area": "Heating" }, "value_template": "{{ (value_json).split(',')[0] }}", "state_topic": "ebusd/global/updatecheck", "name": "ebusd updatecheck", "state_class": "measurement" }

And it works perfectly for me, show in HA:
image

Original value was too long:

"revision v22.2 available, broadcast.csv: different version available, memory.csv: different version available, vaillant/08.bai.csv: different version available, vaillant/15.470.csv: different version available, vaillant/50.v61.mc.csv: different version available, vaillant/bai.0010015600.inc: different version available, vaillant/broadcast.csv: different version available, vaillant/errors.inc: different version available, vaillant/general.csv: different version available, vaillant/hcmode.inc: different version available, vaillant/iotestbmc.inc: different version available, vaillant/scan.csv: different version available, vaillant/tempsetpoints.inc: different version available, vaillant/timercc.inc: different version available, vaillant/timercool.inc: different version available, vaillant/timerhc.inc: different version available, vaillant/"

@leeyuentuen
Copy link
Author

I insert after HA restart new config for updatecheck: { "unique_id": "ebusd_global_updatecheck", "device": { "identifiers": "ebusd", "manufacturer": "ebusd.eu", "name": "ebusd", "sw_version": "22.2", "suggested_area": "Heating" }, "value_template": "{{ (value_json).split(',')[0] }}", "state_topic": "ebusd/global/updatecheck", "name": "ebusd updatecheck", "state_class": "measurement" }

And it works perfectly for me, show in HA: image

Original value was too long:

"revision v22.2 available, broadcast.csv: different version available, memory.csv: different version available, vaillant/08.bai.csv: different version available, vaillant/15.470.csv: different version available, vaillant/50.v61.mc.csv: different version available, vaillant/bai.0010015600.inc: different version available, vaillant/broadcast.csv: different version available, vaillant/errors.inc: different version available, vaillant/general.csv: different version available, vaillant/hcmode.inc: different version available, vaillant/iotestbmc.inc: different version available, vaillant/scan.csv: different version available, vaillant/tempsetpoints.inc: different version available, vaillant/timercc.inc: different version available, vaillant/timercool.inc: different version available, vaillant/timerhc.inc: different version available, vaillant/"

@Koky05 Hi, thx for reply, can you let me know where you have put this config?

@Koky05
Copy link

Koky05 commented Mar 29, 2022

In MQTT Explorer I made publish into topic:
homeassistant/sensor/ebusd_global_updatecheck/config

@john30 john30 closed this as completed in 2fd1d9b Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants