Yep, works as expected.
Ok!
Alrightā¦ I did a new Lovelace example as wellā¦ if you wouldnāt mind would be great if you can check that is working for me?
also maybe see if you can use this: is_state_attr()
and state_attr()
for the missing entity? Should prevent errors if the entity is missing
No go with the lovelace card:
Iām using state_attr()
everywhere already. Unfortunately if it returns unknown
then that still generates a divide by zero error if the sensor is used in a denominator. e.g.
pct_used:
friendly_name: Percent of Plan Used
entity_id: sensor.abb_usage
value_template: "{{ ( 100 * state_attr('sensor.abb_usage', 'usedMb') | float / state_attr('sensor.abb_usage', 'allowanceMb') | float ) | round(1) }}"
unit_of_measurement: '%'
Doesnāt make senseā¦ that line has not changed at all. Only thing I changed was the last lineā¦ Copy error?
I saw @dale3h mentioning the state_attr() and if_state_attr() on discord to correct that exact issueā¦ perhaps look him up on Discord and see wha he said
Could be. I may have messed something up when altering the indentation to add it to a card rather than pasting it in the raw editor. Iāll give it another go.
Will do. Thanks.
Your Lovelace is all good. Something fishy is happening with VSCode column edit. Notepad++ was fine:
OK great. Thanks for confirming Tom.
Hi David, I suspect this is probably a local or ABB issue rather than an issue with your script but I am seeing a lot more of these errors lately:
Logger: homeassistant.components.shell_command
Source: /usr/src/homeassistant/homeassistant/components/shell_command/__init__.py:113
Integration: Shell Command (documentation, issues)
First occurred: 12 November 2020, 20:00:06 (10 occurrences)
Last logged: 07:45:06
Error running command: `/bin/bash /config/abbusage/abbusage_ha.sh`, return code: 6
NoneType: None
Are you seeing the same?
What does return code 6 signify with bash?
I bet the cookie has expired and is not refreshing.
Have you tried running the initial config script again?
I am not with ABB anymore - churned to Superloop a year ago.
Return code 6 is āNo such device or addressā.
I think it could be a DNS issue as the sensor is only failing intermittently. Iāll give the set-up script a go though.
Iām actually thinking of changing providers, Superloop or Future Broadband. Do Superloop have an API?
No API. No CGNAT. only Unlimited plans now. Let me know as we both get $10 disc for 6 months if you use my referral code.