Closed BenGlossop09 closed 2 months ago
Looks like you have a few return codes I dont have. This has put you over the 255 character limit, when this happens Home Assistant just blanks. I have created a New Device PR updating candy.py that should filter out these extra values bringing back under the limit. Everything else you have done looks spot on.
You may find your programs codes differ from the actual mode set. If you spot any feel free to let me know what your numbers correspond to so I can include this for your machine.
Thanks for the revision, that has solved the issue. Note that when an update (to the code) is made a new entity is created eg sensor.candy_washer_dryer_2. The original needs to be deleted (possible through the UI) then restart Home Assistant. This will convert sensor.candy_washer_dryer_2 back to sensor.candy_washer_dryer allowing the configuration.yaml/lovelace entities to update.
When I have a bit more time I will go through all of the programme settings on the machine and identify them. I'd imagine it would be best to make another GitHub issue for this as it is separate to the original issue.
Glad it worked. Good note on changes creating a new sensor. Alternatively opening the file in a text editor and pasting the updated code over the top avoids this too.
Program confirmation would be great if you get time, no problem if not.
Thank you for taking the time to put this together!
I have Hoover washer/dryer model H3DS4965TACBE-80. I have got the encryption key for the model and have followed the configuration steps given for this integration. I believe configuration.yaml is not taking the output of candy.py as HA is giving the error log:
Failed to set state for sensor.candy_washer_dryer, fall back to unknown Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1209, in _async_write_ha_state hass.states.async_set_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 2334, in async_set_internal state = State( ^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 1778, in __init__ validate_state(state) File "/usr/src/homeassistant/homeassistant/core.py", line 239, in validate_state raise InvalidStateError( homeassistant.exceptions.InvalidStateError: Invalid state with length 364. State max length is 255 characters.
HA is seeing a length of 364 and only supports 255, as you state. candy.py is not producing the json correctly or the json is not being interpreted/seen. I ran a test of candy.py and I get a successful output from my machine - candy.py works as intended. Output here:
This leads me to believe the json is somehow not being used by the code in configuration.yaml. For reference here is my configuration.yaml code:
I thought the file path could be an issue, though it looks ok to me. The file path for reference is /config/pyscript/candy.py