-
Notifications
You must be signed in to change notification settings - Fork 55
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
ButtonCardJSTemplateError in General setting #70
Comments
What do you have in |
no, I didn't understand where it should be set |
I have no controller connected in wifi, I cannot set any value |
How do you control your valves? What is the state of your |
Hi, |
@kloggy "input_text.irrigation_external_sensor_controller_wifi" set to "sensor.esphome_irrigation_controller_wifi_signal" if "irrigation_external_sensor_controller_wifi" is unknown or blank. It seems that you are setting this value to "sensor.esphome_irrigation_controller_wifi_signal", which in my case I do not have. (I also assume this is the case for others, as it's not listed as a prerequisite). However a quick search shows it's used throughout your code, such as for Wi-Fi interruption notification. Therefore the code you have in "\lovelace\garden_irrigation\settings\general\item_settings_controller_wifi_signal.yaml" to check to see if the state is undefined is never triggered, as you're always setting it to a state on boot, or if the entities ever set to 'blank' (''). This produces the error "ButtonCardJSTemplateError: TypeError: Cannot read properties of undefined (reading 'state') in 'var statestr = (entity === undefined || entity.state === undefined) ? 'undefined' : entity.state;" Which, if you refresh the webpage, causes the entire button to disappear. I tested this theory by commenting out the code that does the checks, which did indeed bring back the pop-up button. In summary, the checks you have in place to see if the entity is undefined, in "item_settings_controller_wifi_signal.yaml" are resulting in a error, as the entity is being defined to a predefined entity, by an automation, upon each boot. |
There's definitely something not quite right with "item_settings_controller_wifi_signal.yaml". If you accidentally sent the value of "input_text.irrigation_external_sensor_controller_wifi" to a invalid state, such as an entity that does not exist, or a typographical error, the custom button card will just disappear. |
After following your advice I also have the same problem as Bubin1964. Does anyone have a suggestion on how to fix it? Thank's to all |
Hello, I have a problem in principal card and I don't understand why.
I've searched everywhere but can't find a way to fix this problem.
The text was updated successfully, but these errors were encountered: