HASwitchPlate / openHASP-custom-component

Home Assistant custom component for openHASP
https://www.openhasp.com
MIT License
51 stars 12 forks source link

All plates are unavailable when I restart Home Assistant #118

Closed robertsorensen closed 3 weeks ago

robertsorensen commented 6 months ago

As the title suggest - whenever I restart Home Assistant all my plates (All Lanbon L8; mixture of Dimmer and Relay versions) becomes unavailable and I do need to reload each device separately in the Device & Services->Integration menu. I find it unlikely this is a "bug" since other should have experienced it as well so I'm wondering what I could be doing wrong in my implementation.

From the startup log I do get these 2 error messages:

2024-03-11 11:18:39.536 ERROR (MainThread) [custom_components.openhasp] TemplateError('None') while processing template 'Template<template=({{ 0 if is_state("light.living_room_lights", "off") else state_attr("light.living_room_lights", "brightness") }}) renders=4>' in entity 'None' 2024-03-11 11:18:39.726 ERROR (MainThread) [custom_components.openhasp] TemplateError('None') while processing template 'Template<template=({{ 0 if is_state("light.dinner_table_light", "off") else state_attr("light.dinner_table_light", "brightness") }}) renders=4>' in entity 'None' I don't believe that the YAML code I have above is incorrect. Once the intetration is properly loaded all the plates works fine and if I use the template editor in Home Assistant with the expressions above they do return proper values. I'm speculating that the error in the log file is caused byt some of the entities not being "ready" when openHASP integration loads but this may be completely wrong.

I've asked similar question on discord and on the Home Assistant community but have so far not gotten any feedback or suggestions on what to do and how to debug this issue. Hopefully this forum has some suggestions.

I'm currently running 0.71 custom component; 0.7.0-rc11 but I had the same issue when running the released version (0.6.3)

fvanroie commented 3 weeks ago

Version 0.7.6 delays loading the CC until its MQTT dependency is loaded. Maybe this dependency cause the issue; so please test the new version of the custom component.

robertsorensen commented 3 weeks ago

I did install the latest version and did a “very” scientific experiment of restarting HA. When HA had restarted all my plates were online and working. Conclusion: it works! Thanks

fvanroie commented 3 weeks ago

Great, thanks for the confirmation.