#@code-in-progress do you know where

1 messages · Page 1 of 1 (latest)

warm swallow
#

You must have downloaded them at some point.

glass cove
#

alias: Confirmable Notification
use_blueprint:
path: homeassistant/confirmable_notification.yaml

#

thats the yaml of the first one.. i didnt download any other blueprint except that ikea remote control one so dont know how these got here

#

heres another one

#

description: ""
alias: Zone Notification
use_blueprint:
path: homeassistant/notify_leaving_zone.yaml

warm swallow
#

Interesting as HA by default doesn't include any blueprints (that I'm aware of).

glass cove
#

and this is the third one

#

description: ""
alias: Motion-activated Light
use_blueprint:
path: homeassistant/motion_light.yaml

#

i have no idea what these are, i dont have any motion detection devicees

warm swallow
#

Yeah, no clue. Just delete them.

glass cove
#

if i delete these 3, it wont break anything right?

#

since they look empty

#

ok

#

does home assisant auto generate some of these things when u upgrade to a new version? because like when i recently upgraded, it said i no longer needed the iframe from my configuration yaml for my zigbee2mqtt and that iwas integrated into dashboards.. i actually went into the dashboards and i saw there was now in fact a entry for it there so i went ahead (about a week ago) and removed my iframe

#

so maybe it auto generate those things too?

#

i am trying to troubleshoot any issues i get but i do notice in the log files probably unrelated to the above:

#

2024-05-21 14:58:54.651 ERROR (MainThread) [homeassistant.helpers.entity] Failed to set state for sensor.0x385cfbfffe3e3594_learned_ir_code, fall back to unknown
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1203, in _async_write_ha_state
hass.states.async_set(
File "/usr/src/homeassistant/homeassistant/core.py", line 2310, in async_set
state = State(
^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 1788, in init
validate_state(state)
File "/usr/src/homeassistant/homeassistant/core.py", line 228, in validate_state
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state with length 320. State max length is 255 characters.

#

any idea how to resolve this?

#

i see a few more errors higher up lemme see ifi can get it in some readable format

warm swallow
#

The error is due to an integration trying to set a state value to more than 255 characters.

glass cove
#

ya it shows another similar error higher up

warm swallow
#

What integration are you using for that remote?

#

Is that your Ikea remote?

glass cove
#

ya its the same error basically

#

the error is in regard to my IR device

#

lemme see if i can show u what it is

#

so i am guessing its having trouble with mqtt?

warm swallow
#

That or Z2M is setting the state of the entity to over 255 characters. I've seen this before with Z2M. The fix was to update both Z2M to the latest version and also HA to the latest version.

glass cove
#

pretty sure they both the latest but i can try to upgrade the containers again quickly

#

so updated ha z2m and mosquito and restarted lets see

warm swallow
#

I don't even see that device in the Z2M supported devices.

glass cove
#

same error

#

it is supported

#

ya this is the error still:

#

2024-05-21 15:14:26.386 ERROR (MainThread) [homeassistant.helpers.entity] Failed to set state for sensor.0x385cfbfffe3e3594_learned_ir_code, fall back to unknown
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1203, in _async_write_ha_state
hass.states.async_set(
File "/usr/src/homeassistant/homeassistant/core.py", line 2310, in async_set
state = State(
^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 1788, in init
validate_state(state)
File "/usr/src/homeassistant/homeassistant/core.py", line 228, in validate_state
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state with length 320. State max length is 255 characters.

warm swallow
#

Ok, so I'm guessing that there's a few ways to fix this, but not really sure who's responsibility it is. Z2M doesn't have to truncate the string to 255 characters. But, HA (through MQTT) can only support an entity state to be 255 characters. 🤔

#

I'd raise an issue in the HA core github (and tag the MQTT integration) and see where that goes. There's probably going to be some back and forth on which system should actually do the truncation though.

glass cove
#

i do get a mqqt disconnected message at the start as a warning but thats probably because during startup or somehting .. everything is not up and running yet

warm swallow
#

Correct. If you are running MQTT as an addon.

glass cove
#

its all docker containers

#

so there isnt a way i can adjust the lenght of the state myself to make it 255?

warm swallow
#

Nope.

glass cove
#

maybe i need to reconfigure the ir device 😄

warm swallow
#

You can try that, but it didn't make a difference last time I saw this error. And it was another damn remote. lol

#

Try a reconfigure in Z2M and see if that helps...

glass cove
#

it says it can not be reconfigured

warm swallow
#

lol I love Tuya stuff...

glass cove
#

and removing and adding wont do anything right?

#

(i would probably have to reset stuff up too if i did that right)

warm swallow
#

It might, but I don't know if that would affect anything as I know next to nothing about that device (if it stores IR codes locally, would a re-pair reset that?).

#

I would just ignore the error for now and just createa github issue about it.

glass cove
#

the IR codes i wrote into my scripts

warm swallow
#

Ok 🤷‍♂️ Try a re-pair and see what happens? Like I said, I know nothing about the device... sooooo

glass cove
#

like this: {"ir_code_to_send": "A8kEpwFAAwWnAckEQgVABQWnAacByQRACwOnAckEwAMA8yALBfMBaR/JBEARAWsBQAVAIwfJBKcBpwHJBEALA6cByQRAAwDzIAeAAwVpH0IFawFAAwPzAckEQAdAA8ALQAfgAwMBpwHgAS8DpwHJBEArQANAIwJCBTJgB0AL4AED4AEvCfMByQRCBWsBQgWAJwNCBWsBQBPgBQPgCy8FpwGnAckEwAdAC+ABAwFpH8ANA6cBQgXgBwsBpwHAEcAH4AEvAWsBQC8B8wFAAwGnAYALQBPgAwMBpwFALwHzAUADQBdAB0ADATIBgAtAB0AXQAeAA+ABLwMyAUIFQCsDyQRQAoALC1ACywBsAQgXLAA=="}

#

one thing before i do that

warm swallow
#

Huh.... hold on... so, that sensor state... does it change after you send the code?

glass cove
#

in those helper i talked about before i recreated the strybar one but not the other, was it ha that created this shown below: https://imgur.com/y7QmeYZ

warm swallow
glass cove
#

i dont think so, i see nothing showing up in the logbook OR in the HA log files

#

after i click a button on my other remote that then makes the ir blaster send out a code

#

logbooks basically doesnt change except after restarting the whole system and it has like this in the logbook:

#

IR Remote Control Ir code to send became unknown
3:13:51 PM - 19 minutes ago
sensor.0x385cfbfffe3e3594_learned_ir_code became unknown
3:13:51 PM - 19 minutes ago
IR Remote Control became unavailable
3:12:58 PM - 20 minutes ago
sensor.0x385cfbfffe3e3594_learned_ir_code became unavailable
3:12:58 PM - 20 minutes ago
IR Remote Control Ir code to send became unavailable
3:12:58 PM - 20 minutes ago
IR Remote Control became unknown
3:12:23 PM - 21 minutes ago
sensor.0x385cfbfffe3e3594_learned_ir_code became unknown

warm swallow
#

But it still sends the codes, right?

glass cove
#

btw under the MQTT device for the ir blaster it shows this: Device info
Universal smart IR remote control (ZS06)
by TuYa
Connected via Zigbee2MQTT Bridge

glass cove
warm swallow
#

As long as it’s working, I wouldn’t worry too much about this. Raise an issue in github and let the devs know.

glass cove
#

ya i just came across this now because i made some changes to the sytem and wanted to clean up stuff i wasnt using (the blueprint and helper etc) and i decided to check the log file and i saw that

#

can you link the right github to raise this in?

warm swallow
#

Make sure to tag MQTT

glass cove
#

could the helper that i showed in the picuter above for my fans be createdd from this in my configuration yaml?

#

switch:

  • platform: template
    switches:
    living_room_ac:
    turn_on:
    service: script.ac_on
    turn_off:
    service: script.ac_off
    fan:
  • platform: template
    fans:
    living_room_fan:
    friendly_name: "Living Room Fan"
    value_template: "{{ 'on' if states('input_number.living_room_fan') | float > 0 else 'off'}>
    percentage_template: "{{ states('input_number.living_room_fan') }}"
    speed_count: 3
    turn_on:
    - service: script.fan_medium
    turn_off:
    - service: script.fan_off
    set_percentage:
    service: >
    {% if percentage == 100 %}
    script.fan_high
    {% elif percentage == 66 %}
    script.fan_medium
    {% elif percentage == 33 %}
    script.fan_low
    {% else %}
    script.fan_off
    {% endif %}
#

it been a while since i wrote that so i might be overlooking something

warm swallow
glass cove
#

ya i guess i will keep that helper because it appears to be working

#

not sure why i need one though lol

glass cove
warm swallow
#

Yeah, I just looked briefly and I don't see any issues matching what you are seeing. So, create an issue and then add a tag for MQTT.

glass cove
#

report an issue with home assistant core? i am doing that now but i see nothign about tags.. so just put MQTT in the title?

glass cove
warm swallow
#

That works!

glass cove
#

hey you around?

#

i am not sure what they asking: No, I need the config for the entity that causes the failure (in JSON format, there is a switch), the config is probably the correct one, and the state payload (at topic zigbee2mqtt/IR Remote Control) for this entity causing the issue. The bridge state is not relavat for this issue. Did you open an issue for Zigbee2MQTT as you opened an issue at the Home Assistant Core repo.

warm swallow
#

Kinda. Let me digest that...

glass cove
#

he replied to my post in the topic above

#

and i posted what i thought he needed

warm swallow
#

Ok, I'll be AFK for a while (meeting), but I'll see if we can get what you need in a bit.

glass cove
#

ok

glass cove
#

i posted on the thread some more fyi

warm swallow
glass cove
warm swallow
#

Ah, ok. Yeah, that’s where the back and forth is going to happen. HA is going to say Z2M should probably truncate the data to 255 characters for HA and Z2M is going to say it should be done in HA in the MQTT integration. I honestly don’t know which one is right, tbh.

glass cove
#

I posted that whole json, was that the right thing to do?

warm swallow
#

Yeah, should give him enough to go on.

glass cove
#

i am not sure if i am suppose to repsond to this post or someone else, they been talking a bit

#

he linked someone else but it sounded like he was talking to me

glass cove
warm swallow
#

Ah! Good! Got a problem label... that's progress!

glass cove
#

yup lets see if i get some replies soon

glass cove
#

so i played around with the device a bit today and deleted everything about my ir device and readded and i am getting some really different error or rather warning message now that I can make much sense of it:

#

2024-05-26 11:05:58.031 WARNING (MainThread) [homeassistant.components.mqtt.mixins] Erroneous JSON:
2024-05-26 11:05:58.032 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.learn_ir_code }}'
2024-05-26 11:05:58.037 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'value_json' is undefined (value: , template: {{ value_json.learn_ir_code }})
2024-05-26 11:05:58.037 WARNING (MainThread) [homeassistant.components.mqtt.mixins] Erroneous JSON:
2024-05-26 11:05:58.037 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.learned_ir_code }}'
2024-05-26 11:05:58.038 WARNING (MainThread) [homeassistant.components.mqtt.mixins] Erroneous JSON:

#

any idea?

glass cove
#

when i enable the expose in z2m and i test a code out, seems that warning message goes away... so now i get no more warnings or errors

#

i guess i can drop my issue i posted

warm swallow
#

I wouldn’t drop it. It’s still an issue. This one is different.

glass cove
#

i had closed it because i was getting any responses and the problem seemed gone once i deleted all the info about the device and reinstalled it

#

btw any thoughts in regards to my question in zigbee channel regarding z2m vs zha?

warm swallow
#

Not yet. Still waking up. Give me a few minutes

glass cove
#

so i been encountering all kinds of problems since i readded my ir controller.. for some reason when i send a code to my tv, it crashes my z2m with this errror and i cant figure out why:

#

[2024-05-26 23:53:02] info: zh:zstack:znp: Port closed
[2024-05-26 23:53:02] info: zh:zstack:znp: closing
[2024-05-26 23:53:02] error: z2m: Adapter disconnected, stopping
[2024-05-26 23:53:02] info: z2m: Disconnecting from MQTT server
[2024-05-26 23:53:02] info: z2m: Stopping zigbee-herdsman...
[2024-05-26 23:53:02] error: zh:controller: Failed to disable join on stop: Error: Cannot request when znp has not been initialized yet
[2024-05-26 23:53:02] error: z2m: Failed to stop Zigbee2MQTT

warm swallow
#

Those are the only errors?

glass cove
#

Yes it happens when I sent it code of my tv only for power on

#

It occurs even when I send it from z2m expose

glass cove
#

so after further testing, i am getting z2m docker to crash anytime i send a code that is for turning devices on

#

other things like volume up or things similiar doesnt crash z2m docker

glass cove
#

he couldnt see any usesful info there but maybe you do? (he asked in chat if anyone elses sees anything special)

warm swallow
#

Nothing stands out to me either. 😒 Thinking out loud though, it looks like the command is killing the coordinator and then in turn killing Z2M. But, what I don’t see is where that happens. Are you running Z2M as an addon or standalone?

glass cove
#

docker container

#

but i dont know what exactly has changed that is maybe causing all this because this ir code was working.. and now it wont at all.. nothing changed to my script

#

and when i tried this ir code worked earlier, when i tried to fiddle with it and install z2m (and failed), went back to zha but now it wont work

#

but if i plug in my ir code for fan or ac or lights work fine

#

has there been any changes to HA core in the last several months to a year that somehow could have effected this?

#

i did notice that the ir codes i get from my tv are much shorter than those from my other devices

glass cove
#

i made a little progress since we last spoke

#

so i manage to find the ir code for my tv outside of using the ir learn function.. the ir code that the device finds whene using either the original remote or the fire tv remote causes the z2m to crash.. but i manage to find that the preset for the remotes are for changhong tv's so my fire tv can control the tv.. however i cant figure out how to get that code to work for HA

#

i did discover something pretty amazing.. so i got 2 setups here.. one is my original setup with z2m... and one with a basic setup with just zha... 1) obviously when i try to use the learned code from my remote, it crashes z2m but here is the kicker 2) if i use the learned code from the zha setup, it actually CRASHES my z2m!!!!

#

even thought its not even on my first setup (removed when i test it with zha)

#

so after turning off the first machine completely and using the power from the other machine, i can get the ir to communicate with the tv

#

sorry if i am giving u the play by play 🙂