-
Notifications
You must be signed in to change notification settings - Fork 58
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
Not working anymore with 0.115.0 #44
Comments
I feared that, hence asked Balloob and the devs about it, see the answer home-assistant/core#39915 (comment) supposedly another thing? |
I have managed to get it working like this: - service: variable.set_variable
data:
variable: last_motion
attributes_template: "{\n \"history_1\": \"{{ trigger.to_state.attributes.friendly_name|replace('motion\
\ sensor','') }}\",\n \"history_2\": \"{{ states.variable.last_motion.attributes.history_1\
\ }}\",\n \"history_3\": \"{{ states.variable.last_motion.attributes.history_2\
\ }}\",\n \"history_4\": \"{{ states.variable.last_motion.attributes.history_3\
\ }}\",\n \"history_5\": \"{{ states.variable.last_motion.attributes.history_4\
\ }}\",\n \"history_6\": \"{{ states.variable.last_motion.attributes.history_5\
\ }}\",\n \"history_7\": \"{{ states.variable.last_motion.attributes.history_6\
\ }}\",\n \"history_8\": \"{{ states.variable.last_motion.attributes.history_7\
\ }}\",\n \"history_9\": \"{{ states.variable.last_motion.attributes.history_8\
\ }}\",\n \"history_10\": \"{{ states.variable.last_motion.attributes.history_9\
\ }}\"\n}\n"
data_template:
value: '{{ trigger.to_state.attributes.friendly_name|replace(''motion sensor'','''')
}}: {{as_timestamp(states.variable.last_motion.last_changed)| timestamp_custom(''%X'')
}}
'
|
what exactly did you change, I hope you're not referring to all those newlines and slashes? Please explain some more what you had before and how you managed to find what was not working? thanks! or was it merely the addition of 'states' to each line ?
|
It was the addition of states.variable.entity_id that solved it for me. |
Yea that seems to work. Here is the code a bit more clean.
|
confirming this to work, and seems even cleaner:
note we now need th state the full template to the variables state, where before we only needed to reference variable.attributes or variable.state. Also, the main default config
doesnt set the starting value to |
btw we can now (HA 115) leave out the
|
Guys many thanks. Working again! |
This stopped working again after the latest 2020.12.0 update. I am getting the |
Yea, its definetly still working for me on 2020.12.0. Show your config? |
weird.. this is mine
|
not weird, have a look at: #47 |
That fixed it, thanks for pointing me in the right direction :) |
The Variable Component is not working any longer, with the 0.115.0 Update. It's throwing out this Error:
And it doesn't have to do with the script/automation because switching back to 0.114.4 is fixing the error and its working just fine. Probably has to do with the new "Variables" component they brought out.
The text was updated successfully, but these errors were encountered: