I’m not sure if it’s even possible but is there a way to make script which ENABLES all automations which have SUMMER in it’s name while disabling any automiation which has WINTER in it’s name. And opposite to that create a second script which enables every automation which has WINTER in it’s name while disabling any automation which has SUMMER in it’s name?
Thing is I have a shitload of automations that apply to summer or winter only. I want to switch them by one button (using script) depending of current season.
Yes it is possible. However, it is usually better practice to construct automations so that their conditional logic properly manages execution instead of enabling/disabling automations. I tried using the enable/disable method when I first started using Home Assistant and it led to so much frustration. It is too easy to forget how automations are dependant on each other. If you decide to go down this path I would advise that you create all your automations and scripts in the UI or manually assign them unique IDs so that you can use the “Related” entities tool.
For that you will need to incorporate a Choose action and determine how you want to define the “current season”. There is a Seasons integration built into HA, but you may prefer to use Input datetime helpers or some other method.
I agree with @Didgeridrew that it would be better to have your automations taking care of itself instead of enabling/disabling automations.
In the past I’ve tried this for some automations that should be disabled when I have visitors at home, but in the end it became a nightmare, specially because automations become unavailable for some time when reloading automations and that was messing up my whole system, to the point I lost control.
In the end I’ve created a helper (toggle) which is set only when I have visitors and then all the other automations use that as conditions or inside the actions to behave as I’m expecting. Later I’ve automated the detection of some of my frequent visitors and it was much simpler to just set a helper when they are detected, and I still can set it manually (with a button right on the side of my entry door, or from a dashboard).
I agree with both of you that making automations with proper logic is better sollution. Thing is that at this moment I have no bloody idea how this logic should work like
Message malformed: value should be a string for dictionary value @ data['alias']
The hell he wants from me? Changing alias name to enable_winter_automations doesn’t change anything. I compared structure of this script with other scripts I have and it looks the same. Like this one for example:
If you want to use the real season values to make the automations season aware without disabeling them, there is this:
But you can just as easily create sensor or input helper to have a slightly different interpretation of winter.
Once you have the sensor, you can test its state in any automation you like by adding one extra condition that the state of this sensor must be Winter.
That is also true. Before I knew how to use helpers (now I know) I used dummy automations for that - meaning automation which contains nothing inside except name. Then I put such automation in my dashboard to switch it on or off and other automations were checking if this dummy automation is on or off (it was one of conditions for them to start). In other words I’ve made myself helper without using helpers
The error says data['alias']. That’s where you should be looking.
And from experience, I can tell you it’s because you don’t have alias’s value in quotes and you’re using special characters. i.e. [ and ] tell yaml to treat the value differently. You want to assert that this is a string.
the alias field is complaining that it’s not a string. Everything you’ve posted has a string accept what I pointed out. So you’re either looking at an old error or the wrong error or the wrong automation.