juanmijm
(Juanmijm)
September 20, 2022, 10:10am
1
hello colleagues, I can’t figure out how to create an automation in the visual environment when the state of an attribute is of type on, off, true, or false, because in the editor it only accepts string, instead if I go to the yaml editor and removing the quotes works perfectly, but it doesn’t let me have it in visual mode anymore.
I don’t know if I’m doing something wrong or if it’s something that the home assistant developers are overlooking, what do you guys think? Thanks.
juanmijm
(Juanmijm)
September 27, 2022, 2:37pm
2
Hello? Is there anyone here?
123
(Taras)
September 27, 2022, 2:43pm
3
The Automation Editor has several known limitations (and bugs) and you have encountered one of them.
opened 10:43PM - 16 Nov 20 UTC
editor: automation
stale
<!-- READ THIS FIRST:
- If you need additional help with this template please re… fer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Do not report issues for custom Lovelace cards.
- Provide as many details as possible. Paste logs, configuration samples and code into the backticks.
DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment.
-->
## Checklist
- [x] I have updated to the latest available Home Assistant version.
- [x] I have cleared the cache of my browser.
- [x] I have tried a different browser to see if it is related to my browser.
## The problem
<!--
Describe the issue you are experiencing here to communicate to the
maintainers. Tell us about the current behavior.
If possible provide a screenshot with a description.
-->
When creating an automation in the frontend for an entity which has a Boolean value as its state, the UI adds quotes around the value. Even when editing the YAML (via the frontend) it then adds quotes when you save the automation.
## Expected behavior
<!--
Describe what you expected to happen or it should look/behave.
If possible provide a screenshot with a description.
-->
Expected that the frontend would allow for strings and Boolean values for entity states.
## Steps to reproduce
<!--
Provide steps for us, that helps reproducing your issue.
For example:
1. Add a climate integration
2. Navigate to Lovelace
3. Click more info of the climate entity
4. Set the HVAC action to heat
5. Set the temperature higher than the current temperature
6. Set the HVAC action to cool
-->
1. Create a new automation.
2. Using an entity which has a Boolean value as its state, set the trigger as (for example) `to: True`.
3. Select "Edit as YAML"
4. The UI has added quotes
5. Remove the quotes
6. Save the automation
7. Go back into the automation
8. Select "Edit as YAML" again
9. The quotes are around the Boolean value again
## Environment
<!--
Provide details about the versions you are using, which helps us reproducing
and finding the issue quicker. Version information is found in the
Home Assistant frontend: Configuration -> Info.
Browser version and operating system is important! Please try to replicate
your issue in a different browser and be sure to include your findings.
-->
- Home Assistant release with the issue: 0.117.6
- Last working Home Assistant release (if known): Unknown
- Browser and browser version: Safari, Chrome
- Operating system: iOS, Windows
## State of relevant entities
<!--
If your issue is about how an entity is shown in the UI, please add the state
and attributes for all situations with a screenshot of the UI.
You can find this information at `/developer-tools/state`
-->
```yaml
```
## Problem-relevant configuration
<!--
An example configuration that caused the problem for you. Fill this out even
if it seems unimportant to you. Please be sure to remove personal information
like passwords, private URLs and other credentials.
-->
```yaml
```
## Javascript errors shown in your browser console/inspector
<!--
If you come across any javascript or other error logs, e.g., in your browser
console/inspector please provide them.
-->
```txt
```
## Additional information
Joe3
September 27, 2022, 2:59pm
4
When using my visual editor this is what I get if I use not.
alias: Test Sun
description: ""
trigger: []
condition:
- condition: not
conditions:
- condition: sun
after: sunrise
action:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.test2_toggle
mode: single
juanmijm
(Juanmijm)
September 27, 2022, 3:06pm
5
wow, error/limitation still since 2020
juanmijm
(Juanmijm)
September 27, 2022, 3:08pm
6
ok, this is good for contition, but i have another example as a trigger:
Can you just use a sun trigger?
Joe3
September 27, 2022, 3:35pm
8
So holding to the question of making an automation with the visual editor. I was still able to make this.
alias: Test Sun
description: ""
trigger:
- platform: state
entity_id:
- sun.sun
attribute: rising
to: "off"
condition: []
action:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.test2_toggle
mode: single
The visual editor made this and has no problem with it.
Am I missing something?
juanmijm
(Juanmijm)
September 27, 2022, 6:32pm
9
off with quotes is a string, I’m not sure if that works or not, but if it works on the trigger it should work on the conditions, and it doesn’t work in visual editor for conditions.
juanmijm
(Juanmijm)
September 27, 2022, 6:36pm
11
[/quote]
sun trigger it’s a very very basic trigger, only have this options, sunset is not the same as going from rising true to rising false…