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

Sonoff TRVZB Schedule (composite) entity state is too long for HA #23199

Closed
markxroberts opened this issue Jun 29, 2024 · 24 comments
Closed

Sonoff TRVZB Schedule (composite) entity state is too long for HA #23199

markxroberts opened this issue Jun 29, 2024 · 24 comments
Labels
problem Something isn't working

Comments

@markxroberts
Copy link

What happened?

Repeated errors in HA logs because the entity state is too long

2024-06-28 01:15:56.348 WARNING (MainThread) [homeassistant.components.mqtt.sensor] Invalid state message '{'friday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'monday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'saturday': '00:00/16 07:00/19 10:00/19 10:00/19 10:00/19 23:00/16', 'sunday': '00:00/16 07:00/19 10:00/19 10:00/19 10:00/19 23:00/16', 'thursday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'tuesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'wednesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16'}' from 'zigbee2mqtt/Utility radiator'

What did you expect to happen?

Perhaps split in to multiple entities

How to reproduce it (minimal and precise)

Pair valve, state message rejected.

Zigbee2MQTT version

1.38.0

Adapter firmware version

zStack3x0 20220219 and ConBee2/RaspBee2 0x26780700

Adapter

Sonoff ZB-Dongle-P and ConBee2

Setup

Container on Debian VM / AMD Ryzen processor

Debug log

No response

@markxroberts markxroberts added the problem Something isn't working label Jun 29, 2024
@fir3drag0n
Copy link

Same problem here

@michelbalzer
Copy link

michelbalzer commented Jul 4, 2024

Maybe related to #19788 #home-assistant/core#103141 and #16460?

I have this messages:

Logger: homeassistant.components.mqtt.sensor
Quelle: components/mqtt/sensor.py:265
Integration: MQTT ([Dokumentation](https://www.home-assistant.io/integrations/mqtt), [Probleme](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+mqtt%22))
Erstmals aufgetreten: 08:43:24 (4 Vorkommnisse)
Zuletzt protokolliert: 08:43:27

Invalid state message '{'friday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17', 'monday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17', 'saturday': '00:00/17 08:00/21 12:00/17 14:00/20 18:00/17 18:00/17', 'sunday': '00:00/17 08:00/21 12:00/17 14:00/20 18:00/17 18:00/17', 'thursday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17', 'tuesday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17', 'wednesday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17'}' from 'zigbee2mqtt/Kinderzimmer Thermostat'```
Logger: homeassistant.components.mqtt.sensor
Quelle: components/mqtt/util.py:375
Integration: MQTT ([Dokumentation](https://www.home-assistant.io/integrations/mqtt), [Probleme](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+mqtt%22))
Erstmals aufgetreten: 08:43:24 (4 Vorkommnisse)
Zuletzt protokolliert: 08:43:27

Cannot update state for entity sensor.kinderzimmer_thermostat_weekly_schedule after processing payload on topic zigbee2mqtt/Kinderzimmer Thermostat. The requested state (477) exceeds the maximum allowed length (255). Fall back to unknown, failed state: {'friday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17', 'monday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17', 'saturday': '00:00/17 08:00/21 12:00/17 14:00/20 18:00/17 18:00/17', 'sunday': '00:00/17 08:00/21 12:00/17 14:00/20 18:00/17 18:00/17', 'thursday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17', 'tuesday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17', 'wednesday': '00:00/17 07:30/21 09:00/17 14:00/20 18:00/17 18:00/17'}

image

@bchhabra
Copy link

bchhabra commented Jul 4, 2024

same problem on z2m 1.38.0.

Logger: homeassistant.components.mqtt.sensor
Source: components/mqtt/sensor.py:265
integration: MQTT (documentation, issues)
First occurred: 7:44:21 PM (1 occurrences)
Last logged: 7:44:21 PM
Invalid state message '{'friday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'monday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'saturday': '00:00/16 07:00/19 10:00/19 10:00/19 10:00/19 23:00/16', 'sunday': '00:00/16 07:00/19 10:00/19 10:00/19 10:00/19 23:00/16', 'thursday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'tuesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'wednesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16'}' from 'zigbee2mqtt/Office Trv'

Cannot update state for entity sensor.office_trv_weekly_schedule after processing payload on topic zigbee2mqtt/Office Trv. The requested state (477) exceeds the maximum allowed length (255). Fall back to unknown, failed state: {'friday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'monday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'saturday': '00:00/16 07:00/19 10:00/19 10:00/19 10:00/19 23:00/16', 'sunday': '00:00/16 07:00/19 10:00/19 10:00/19 10:00/19 23:00/16', 'thursday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'tuesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'wednesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16'}

@Koenkk
Copy link
Owner

Koenkk commented Jul 6, 2024

Pushed a fix, can you check if it works?

Changes will be available in the dev branch in a few hours from now.

@markxroberts
Copy link
Author

markxroberts commented Jul 6, 2024

Thanks for doing this. I've tried the dev branch. I think that this truncates the state length for a text entity. Am I right in thinking this is separate to a sensor entity (this is how this field is currently represented)? It doesn't solve the problem with errors for me.

@Koenkk
Copy link
Owner

Koenkk commented Jul 8, 2024

Yes this should truncate the text, I'm not sure what exactly this error means, @jbouwh, what does the following error mean?

2024-06-28 01:15:56.348 WARNING (MainThread) [homeassistant.components.mqtt.sensor] Invalid state message '{'friday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'monday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'saturday': '00:00/16 07:00/19 10:00/19 10:00/19 10:00/19 23:00/16', 'sunday': '00:00/16 07:00/19 10:00/19 10:00/19 10:00/19 23:00/16', 'thursday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'tuesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'wednesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16'}' from 'zigbee2mqtt/Utility radiator'

@raarts
Copy link

raarts commented Jul 11, 2024

@Koenkk Maybe because JSON is expected and the message uses single quotes?

@Koenkk
Copy link
Owner

Koenkk commented Jul 11, 2024

@raarts I don't think the JSON is interpreted because I guess this error is for the text sensor?

@raarts
Copy link

raarts commented Jul 12, 2024

I was just guessing, reading it back the tone was not how I intended, sorry about that.

@Der-WU
Copy link

Der-WU commented Jul 13, 2024

Can cofirm that the error still exist.
I am using 8 TRVZB from Sonoff and got 2 errors:

`Logger: homeassistant.components.mqtt.sensor
Quelle: components/mqtt/sensor.py:265
Integration: MQTT (Dokumentation, Probleme)
Erstmals aufgetreten: 10:01:01 (156 Vorkommnisse)
Zuletzt protokolliert: 11:01:46

Invalid state message '{'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'wednesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16'}' from 'zigbee2mqtt/Badezimmer Heizung '
Invalid state message '{'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'wednesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16'}' from 'zigbee2mqtt/Badezimmer Heizung '
Invalid state message '{'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'wednesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20'}' from 'zigbee2mqtt/Badezimmer Heizung '
Invalid state message '{'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'wednesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20'}' from 'zigbee2mqtt/Schlafzimmer Heizung'
Invalid state message '{'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'wednesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20'}' from 'zigbee2mqtt/Svenja Heizung'`

`Logger: homeassistant.components.mqtt.sensor
Quelle: components/mqtt/util.py:375
Integration: MQTT (Dokumentation, Probleme)
Erstmals aufgetreten: 10:01:01 (156 Vorkommnisse)
Zuletzt protokolliert: 11:01:46

Cannot update state for entity sensor.badezimmer_heizung_weekly_schedule after processing payload on topic zigbee2mqtt/Badezimmer Heizung . The requested state (477) exceeds the maximum allowed length (255). Fall back to unknown, failed state: {'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16', 'wednesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16'}
Cannot update state for entity sensor.badezimmer_heizung_weekly_schedule after processing payload on topic zigbee2mqtt/Badezimmer Heizung . The requested state (477) exceeds the maximum allowed length (255). Fall back to unknown, failed state: {'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'wednesday': '00:00/16 07:00/19 10:00/16 10:00/16 17:00/19 23:00/16'}
Cannot update state for entity sensor.badezimmer_heizung_weekly_schedule after processing payload on topic zigbee2mqtt/Badezimmer Heizung . The requested state (477) exceeds the maximum allowed length (255). Fall back to unknown, failed state: {'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'wednesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20'}
Cannot update state for entity sensor.schlafzimmer_heizung_weekly_schedule after processing payload on topic zigbee2mqtt/Schlafzimmer Heizung. The requested state (477) exceeds the maximum allowed length (255). Fall back to unknown, failed state: {'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'wednesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20'}
Cannot update state for entity sensor.svenja_heizung_weekly_schedule after processing payload on topic zigbee2mqtt/Svenja Heizung. The requested state (477) exceeds the maximum allowed length (255). Fall back to unknown, failed state: {'friday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'monday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'saturday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'sunday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'thursday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'tuesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20', 'wednesday': '00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20'}`

i have try to set every day only to 00:00/20 but on safe it create 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 00:00/20 .
sorry for my bad english.

Setup Info:

What did you expect to happen?
Only Pair the devices. Try to Change the default values.

How to reproduce it (minimal and precise)
Pair valve, state message rejected.

Zigbee2MQTT version
dev ( 12.07.2024 )

Adapter firmware version
EZSP v8 6.10.3.0 build 297

Adapter
Sonoff ZB-Dongle-E

Setup
Debian Homeassisstant OS on Raspberry PI5

Greatz

@Der-WU
Copy link

Der-WU commented Jul 29, 2024

Any update about this issue?

@h3llrais3r
Copy link

h3llrais3r commented Jul 31, 2024

Same problem here.
Any workaround until it can be fixed?

@michelbalzer
Copy link

michelbalzer commented Aug 2, 2024

Seems fixed with 1.39.1?

@Der-WU
Copy link

Der-WU commented Aug 2, 2024

Still exist on 1.39.1. :(

@h3llrais3r
Copy link

I'm also still seeing the same warning with latest 1.39.1 release.

@Koenkk
Copy link
Owner

Koenkk commented Aug 5, 2024

I cannot reproduce this issue with my own TRVZB on 1.39.1, can you try to remove the device via the z2m frontend (such that it disappears from HA) and re-pair it?

@Der-WU
Copy link

Der-WU commented Aug 6, 2024

I cannot reproduce this issue with my own TRVZB on 1.39.1, can you try to remove the device via the z2m frontend (such that it disappears from HA) and re-pair it?

I will check it tommorow and let you know.

@markxroberts
Copy link
Author

I've tried deleting and re-pairing. I'm sorry to say that it still gives me the same error. If you don't use this particular entity, you can of course disable it, which has solved the problem for me!

@Der-WU
Copy link

Der-WU commented Aug 12, 2024

Confirm. Delete all trv. Repair them. Error comes back. Disable the enteiti Remove the errors. I Do Not use the sheudle. So it is Not a Problem die me. But it still exist. :) Great

@fir3drag0n
Copy link

Problem still exists

@ishbuggy
Copy link

Problem still exists in TRVZB version 1.1.5.

@Koenkk
Copy link
Owner

Koenkk commented Sep 20, 2024

Finally managed to find and fix the issue!

Changes will be available in the dev branch in a few hours from now.

@Koenkk Koenkk closed this as completed Sep 20, 2024
@hilburn
Copy link

hilburn commented Oct 25, 2024

@Koenkk would it be possible to change the behaviour of the converter to instead split it out into separate attributes for each day:

schedule_monday:
schedule_tuesday:

etc rather than merging the value and truncating them?

@mohoo
Copy link

mohoo commented Nov 23, 2024

@hilburn That would be really helpful. Currently the weekly_schedule attr is useless in home assistant because it is cut off.

As a workaround, you can write a separate mqtt sensor for each day of the week.

mqtt:
  sensor:
    - name: "Weekly Schedule Friday"
      state_topic: "zigbee2mqtt/LivingRoomClimate"
      value_template: "{{ value_json.weekly_schedule['friday'] }}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests