#blueprints-archived
1 messages · Page 10 of 1
im sorry. I was not trying to have you write it for me. i am just missing something in my understanding. The code is https://dpaste.org/RN2uD
Really simple i admit. i will look at the pinned ones and see if I can figure out the pieces.
I understand about the phone and data, i am sorry to lean too heavy on you.
-That is a good idea, to write the automation first and then twist it into a blueprint. I will try that first.
@tough zephyr I am trying to make an automation that does this, but i can not get the dropdowns to put in variables that will be passed through. I tried to copy what you had in the pinned and in the samples. I guess i am missing something. Any thoughts?
The problem is getting it to at least ask for input for the 4 variables, or let me use the dropdowns to set the variables.
-it won't let me save either: https://dpaste.org/y9wEh
Any ideas would be appreciated
!inputs come from the top of the blueprint, and are not 'really' executed code. They are for user inputs. When you pull data out of a rest API you are needing templates and variables and all the stuff that also works in regular automations. !inputs cannot come from an API that I know of.
Get this working as an automation. Where there would be multiple choice IE !inputs, put actual data there that would work as one of the multiple choice responses.
Get your idea working in a limited one example way, then start with making it a blueprint.
Ok, i will reorder it. How would I put in the string to use the drop-down? Or should I do where it is just manual?
Get it running manual with one of the set of valid responses. Start small and build on it. I have a fair amount of blueprint experience but I start with either a working automation and adapt it, or I adapt a similar blueprint where the logic is already working.
You are learning new things in automations and trying to change them into a blueprint , and you don't know what your errors are from. One thing at a time...
One small thing at a time...
Thanks for the guidance. Baby steps. My priest would often tell me the same thing. Lol. I guess i am trying to eat the elephant in two bites. Lol.
I'm trying to pass a script as an input variable in an automation blueprint and call that in an action sequence
but i'm getting an error - is this even possible?
scene_default_script:
selector:
entity:
domain: script
this is how i've defined my input variable - and the blueprint allows me to select a script
and i'm calling the script in my actions
- service: !input scene_default_script
data: {}
when i try to create an automation using this blueprint i get this error in my logs
2022-06-26 11:29:45 ERROR (MainThread) [homeassistant.components.automation] Blueprint Room Scene Switcher using Ikea Dimmer generated invalid automation with inputs OrderedDict([('dimmer_zigbeename', 'Guest Scene Switcher'), ('scene_selector_helper', 'input_select.media_scene_selector'), ('target_airconditioner', 'climate.media_room_ac'), ('scene_off_script', 'script.mediaroom_off'), ('scene_relax_script', 'script.mediaroom_relax'), ('scene_default_script', 'script.mediaroom_relax'), ('scene_Bright_script', 'script.mediaroom_bright'), ('scene_roompoweroff_script', 'script.mediaroom_off'), ('scene_bright_script', 'script.mediaroom_bright')]): Service scene_relax_script does not match format <domain>.<name> for dictionary value @ data['action'][3]['choose'][1]['sequence'][0]['service']. Got None
what am i doing wrong here?
Simplifying my question - I'd like to choose a "script" as an input.....and call the chosen script in my actions sequence
It's not liking the format of the name or the input or something. Break it down to see where the problem is. First instead of calling service: !input, put the actual script name in there and see if it works. Then you know if the !input syntax is a problem or something else.
@candid radish
I successfully got this blueprint to work to control and dim my light bulb with an Ikea on/off button:
But for some reason I've only got 2 of my 3 switches showing up in the blueprint. I've checked the 1 switch that isn't showing up vs the other switches and the manufacturer and the model of the switch match, which is what the blueprint appears to check against
any ideas why the 3rd switch isn't showing when configuring an automation with the blueprint? The only thing I don't know how to check is the "remote" domain?
It's ikea, ZHA, so you will need to look at the events it sends out and the trace of the blueprint to see what is happening.
If you need more traces stored to get a better look at what's happening, this is how:
https://www.home-assistant.io/docs/automation/troubleshooting/#traces
I dont know if a trace is gonna help. I can’t get past the automation creation step. This is because the switch i want to create the automation for isnt showing up as an option in the blueprint/automation gui
Does anyone knows good blueprints for energy management with solar energy? e.g. I want to automatically make my car charge if the power output of by pv is over 2kW for 15 mins (and stop if under) and so on...
Make my washing machine / dryer start automatically, make my nas do backups and so on...
As a part of a blueprint I have the following selector. It does not return any matches. I believe it should return all my lights and switches. Is this the right interpretation of the docs?
target:
entity:
domain: ['light', 'switch']```
`domain: light` works; `domain: [light]` does not return anything
Docs say that a list of domain is valid https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector
Does anyone know if there is a way to filter devices in a selector according to multiple models? i.e. I want a list of all models that match any of these model strings. For example, I would like to do this: ```
selector:
device:
integration: zwave_js
manufacturer: Inovelli
model:
- LZW31-SN
- LZW36
entity:
domain: light
But it doesn't like that. I can use either *one* of those models and it will work, but trying to do both like that gives me an error.
i was sent here from #automations-archived by RobC:
i am seeing how to have an automation to look for an input. would this be correct monkey_entity: !input monkey_entity
or should it be
monkey_entity: !input {{monkey_entity}}
Also, is there a good on-line (or offline) yaml tester/validator so i can see if my code is correct or testing?
any ideas?
Hey, all, hopefull everyone is doing well so far today 🙂 so im back with new problems and questions 😄 Today im trying to optimize and simplify some of my basic GUI automations, is there a way to simplify theese two automations and to create one out of them ?
got solved, thanks to @hardy patio on #templates-archived 🙂
Any help on putting this thing right would be appreciated. I have no idea how to fix the issues or what i am missing. i built this from a working automation. i am trying to get it so i can choose from either a list or something.
https://drive.google.com/file/d/11Fk5SFulzlT3OOmUn_d89L21XRjAMnJt/view?usp=sharing
https://drive.google.com/file/d/11Dc9NyJ1oYJYsKeXcPFoNq3vwHAHEkXo/view?usp=sharing
https://dpaste.org/q88QR
I could really use some help/guidance.
Looking at https://www.home-assistant.io/docs/blueprint/schema/#example-blueprints your blueprint is ... a train wreck
Your indenting is all over the place
You've got
monkey_entity: !input monkey_entity
``` when that's not what the doc show at all
I'll gloss over the fact that it has no trigger
Oh, and you've embedded the definition of the rest command in the automation action, which you can't do
You also (as discussed before) can't embed a secret in the middle of a string like that
https://www.codepile.net/pile/4Xr4MvKP is closer to the indenting you need, but it's still missing many things to make it a valid blueprint
Oh, and you really really should read those links to understand a bit more about YAML and why indenting is key
ok, thank you. I would say trainwrek is being generous. lol.
i am reading through, and i thought I had replicated from the examples. How do you embed the rest command? the section below that is the meat. I remember about the URL part, i had kept it there as a placeholder.
Here is the thinned down version, almost no errors,
https://dpaste.org/WMX13
Thoughts?
How can I have that service be called?
What on earth are you trying to do?
Blueprints are for automations, and that looks nothing like an automation
Also, "almost no errors" tells us nothing about the errors you are getting...
If you're trying to change the values in the URL of the REST command (or the payload) then blueprints isn't the answer, that's entirely down to some templating with that #integrations-archived
ok, thank you. Won't i need to write in python, js, and yaml to write an integration?
when we talked before about building an integration, and I read the document you sent me to and it spoke of creating 3 files and such.
in js, py, and yaml. so i don't need to do those too?
That was for something more complex than simply templating a URL
@plucky bison When using Discord's Reply feature it defaults to pinging the person you reply to, which can get frustrating for the target. Use Shift + click on the Reply option, or click @ ON to @ OFF to stop this - on the right side of the compose bar.
You have to change this every time (thank the Discord devs for that).
Last reminder, turn off the fecking notification ping
ok, sorry. I didn't notice that. lol
If you want to template the URL of the REST command #integrations-archived you can do that already
I'll let somebody else help you with #templates-archived and that integration - but you're really going to have to step away from your solution and describe the problem
The XY problem is asking about your attempted solution rather than your actual problem.
This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.
The problem occurs when people get stuck on what they believe is the solution and are unable to step back and explain the issue in full.
ok, what do you mean about stepping away from the solution? There is a better way to do what I am trying to do?
What are you trying to do?
Because it looks like you're trying to template a REST command
That has nothing to do with blueprints, or automations
And the REST command supports templates
oh, ok. With the service Voice Monkey (app.voicemonkey.io) you go in and fill in fields to select a voice, text to speak, and several other fields that generates a url that ties back into the Alexa ecosystem to "say" the payload (which can include mp3's and pictures) out of an echo device. I am trying to bring the process into my HA and either have it speak it on demand like from the TTS, or at least generate the URL components. My ultimate goal is to select it as a 'something' (service, action, etc) when creating an automation, fill in the fields, and then the automation is complete. I hope that explains it a little better what my end state goal is. I was trying to do it without leaning too heavily on the community. But I know when I am over my head.
This would be useful to the community as well, as an integration. At least I think so.
And, yet again, the fucking notification ping...
I'm done, others can help you
im sorry, i thought it turned it off on all for you when i turned it off in the other chat. Do i have to turn it off for each reply? can i turn it off globally? I am sorry if I offended/annoyed you. I understand if you don't reply. thank you for the help so far.
understood. i see it now. Sorry. I will be more aware.
So im trying my luck out here, I get the idea, I know what I need, but I just can do such an automation in my day 3/4 on YAML and doing it in the UI with like 5 automations isn’t the best way, so im trying my luck here looking for a template / blueprint to do the following, if the iRobot Script isn’t working, when a movement is detected and the Brightness is below 50 lux turn on the light, if there has been no movement for 20 sec, and the robot script isn’t running, turn off the light
iRobot script: irobot_with_automatic_lights
Light entity: switch.0x54ef4410003b3633
Movement detection entity: binary_sensor.motion_sensor_storage_room_occupancy
Brightness Entity: sensor.motion_sensor_storage_room_illuminance_lux
Blueprints are basically automations (or scripts) that can be called with variable inputs. You need to build an automation before you have a chance at getting a blueprint to work. I cover this in the pins... 📌
You can look thru the blueprint exchange to see of someone else has solved your problem,
What you describe sounds like a simple logic problem and an automation should be your answer.
@tough zephyr i have some functional automations, and i have read the pins. However, it seems that it needs more to make it into a blueprint. Also, is there a way to generate a text string from multiple inputs? Like input a name, location, and day for it to create something like "hello NAME and welcome to LOCATION on DAY"
Any thoughts would be great.
As mentioned to you several times lately that is a template, using HA's jinga2 formatting.
I have not heard of jinga2, my editor does not have a language for it (notepad ++). Where do i get an editor for that language?
I am confused, and maybe I am not expressing it right. I have seen many blueprints and automations in the community that build a text string from sensor data and/or inputs/variables for things like notifying that someone entered or departed a zone. Those are in YAML it seems. I have not quite been able to reverse engineer how they did it.
I am sorry if I am frustrating you, i am frustrated too because the concept seems so simple. I used to do it with old fashioned batch files all the time..
action:
- device_id: !input notify_device
domain: mobile_app
type: notify
message: {{ states ('door_name') }} has opened
title: "Notice: "
door_name is entered by the user when using the blueprint. i could settle for the friendly name of the device/sensor.
You have to quote your template. door_nameis a variable name so you should no quote it ({{states(door_name)}}. And finally, states(...) will return on or off (or something equivalent). If I understand correctly what you want to do, is should be someting like
message: "{{ state_attr(door_name, 'friendly_name') }} has opened"
Thank you for replying. It is throwing an error (Error: Error rendering message: UndefinedError: 'door_name' is undefined) about the name being undefined.
This is the code for the blueprint: https://dpaste.org/30e8h
I define door name, and the other components. I can't see why it wouldn't work. Any thoughts/ideas?
To use an input in a template you should first create a variable
action:
variables:
door_name: !input door_name
ok, i put it in, then the code studio and it looks clean. No errors are thrown in the trace. However it does not send out the notification when i trigger it manually. I tested to make sure it was not my device, and it still gets alerts from some of the other automations.
The placing of the code gave me some errors, I adjusted the spacing and such to quiet it down. https://dpaste.org/vrv46
Does this look right?
Could it be simplified to just grab the friendly name from the door_entity since they are basically the same?
Sorry about this being a bigger mess.
I'm trying to create automations from a blueprint, but i am having issues with the automation triggering multiple times with one event
Blueprint in question: https://community.home-assistant.io/t/aqara-buttons-all-in-one-zigbee2mqtt/268717/
Someone (@tough zephyr ) provides a "fix" or solution in the last post but I can't make sense of how to implement what they are saying
You put everything under variable 🙂 the notify part should be kept appart
Ok, sorry, i can see where that is an issue.
https://dpaste.org/BO0Ri
So now it sends the notification again, but no matter what I put in the door name field it sends the word "None" . There are no errors in the trace.
When i use it to create an automation it has "undefined" in the door name. It pops up when i backspace it out. and if I leave it the message still says "None has opened".
Is it maybe because the door_name isn't an entity? I really appreciate your help on this.
@spark junco Ok, i figured it out. looks like I just needed to grab the field from the sensor selected. https://dpaste.org/kOKax
i really appreciate all of your help. i could not have gotten here without you.
I wonder, do you know of a way to have it restrict the list of items to choose from to just the door sensors like when we select the notify device?
You’re welcome. No I don’t know, I don’t think you can
quick question would you be willing to help me on a somewhat more complex script? Also, how do you set something up to be a script vs a blueprint when you code it? I looked in the one script template i have and it still says blueprint at the top.
Any thoughts?
There you go. It's not that hard to understand if you get the syntax correct...
https://community.home-assistant.io/t/aqara-buttons-all-in-one-zigbee2mqtt/268717/42
I wrote the condition for you. You are welcome.
Ahhh ok so basically I should make my own copy of the blueprint, and add your mod too it. Is this correct?
yup, or find the owner and have them add it to the master copy so everyone has it.
Do your own first to make sure I didn't fumble finger it, I cannot test it myself.
Ok great thank you!
Maybe my Code or Blog will help you, found here:
WhatAreWeFixing.Today Home Assistant GIT Config & Blueprint Repo & Website.
I figured out the way to limit the list to only the binary sensor, and doors only.
door_entity:
name: Sensor Selection
description: Select the door sensor or group to alert
selector:
entity:
domain: binary_sensor
** device_class: door**
unable to execute the autmation generated by a motion blueprints >
- id: '1657155629961'
alias: Living Motion
description: ''
use_blueprint:
path: homeassistant/motion_light.yaml
input:
motion_entity: binary_sensor.living_motion
light_target:
entity_id: switch.bed_light_socket
That's not a light, it's a switch
Try using switch_as_x to wrap it with a light entity, and use the new light entity
Thanks
is there any way to run the motion light blue print only at night ?
Only by re-writing it
you could create an automation that activates the blueprint at certain hours
a blueprint is used as an automation
so that automation would be deactivated until another automation is triggered and activates it
Yes, but not the blueprint
i use blueprint and it created a automation. it works fine. now i need to run only at night
Just write the automation from scratch, it's not hard 😉
there is other ways to do it other than writing an automation from scratch
You could also just modify the blueprint
you have the blueprint automation setup
just create a second automation that is time dependent to activate/deactivate the blueprint automation
will try now
https://www.codepile.net/pile/a2WavG4o is one quick and easy modification
All-in-all, Blueprints in the exchange are a great place to get started seeing how stuff works, but relying just on the existing Blueprints (and BP makers) is not what you want. You often need to do something nitchy that only you need, so writing a small automation that turns on a light based on a motion sensor and time of day is a very easy task and a good place to start. The Automation UI almost builds it for you, When it's done, do yourself a favor and look at the YAML as well...
i have a question. i created a blueprint, and it works as expected to notify when a door is open. However, it does not seem to put the code in the automation it creates. it is almost like the automation is relying on the blueprint to be there and unchanged in the future.
I say that because when i changed the blueprint to try and add functionality the automation that I had already made failed. When i reverted the blueprint it went back to functioning.
Previous blueprints did not do this. So i was wondering if I am missing a 'something' that has it write to the automation all it needs to work?
The previous automations I made from blueprints came from the blueprint repository (well most of the code) and i modified them to fit. That seems to be the only main difference i can think of. any thoughts?
Is there a selector that allows the user to input multiple custom string values?
I tried the select selector like this:
select:
options:
- Enter Playlist URI
multiple: true
custom_value: true
And like this
select:
options:
multiple: true
custom_value: true
Both don't allow the input of custom values
A select is "choose from one of the following pre-set options". You're likely after a text field
I could use a multiline text, but I need the results as a list, so that I can pick one of the values per random
Selest selector returns a list i believe.
No idea what you are saying. You need to show me the automation that calls a blueprint but doesnet neet the blueprint...
the automation, in automations.yaml (which is throwing an error because I deleted the blueprint) . In the automations.yaml it only has:
**
- id: '1657419456369'
alias: A1 V2 V23
description: ''
use_blueprint:
path: homeassistant/door_open_monitor_group.yaml
input:
notify_device: 83d441734ad32fe726b1e96dc57bc9g
**
instead of the usual more detailed automation detail. This is why it does not make sense. Any thoughts as to why this does it when the others made from a previous blueprint do not.
Are there any blueprints where you can get notified in the morning if any state changes occurred overnight for any number of different devices?
I couldn't locate any on the website
If you...
use_blueprint:
path: homeassistant/door_open_monitor_group.yaml
Then the blueprint has to be there.
You send the blueprint inputs, and all the base logic is there.
All blueprints require this... Blueprints themselves are the engine, you send it programming inputs. That's how it works. You could not have deleted other blueprints and have an automation that called them still work.
Soo, state changes happen hundreds of times per second.
You can look in history to look at changes.
ok, i think i understand. the blueprints are the framework that the information pass through to generate an outcome. right? The previous blueprints i created are still there because they are functioning. I had to delete the one that is not working after I worked on it and tested to allow the system to save and quit throwing errors. I think i understand their place in the world now and to not delete any when I am working on the system unless i want all the automations created with them to die.
Mostly just looking for if certain sensors went off and to have it do notify announcements in the morning like if something in the fridge started leaking on my water leak sensor overnight, not urgent enough to get an alert at 1am but It'd be good to get the alert in the morning. Just a list of things like that.
There about 50 ways to build automations and scripts for that. Very simple things generally noone writes blueprints for.
can someone help with with the Doorbell - Notify Alexa and/or Google and send camera snapshot, I installed it and getting the Alexa notification alert, but I should also get the IOS alert via the app with a jpg but that's not working for me
I'm having an issues with the YAMA blueprint only running the ON part, but never attempts to turn OFF my lights
I'm looking at the trace, and I can see that it reaches the split point where it decides if the lights should be on or off, but instead of choosing OFF, it just bypasses it and goes around it. and then NEVER turns off
That would be because the condition it’s looking for, for the OFF is not fulfilled
The blueprint only asks for the toggle entity, which is my motion sensor. It does say that it has to be something that toggles between on and off, which it does
I'm drawing a blank
Here's a question which might be a bug report but I'm not quite sure what the intended behavior is supposed to be. When I deploy a blueprint that has boolean toggle switches, and then edit the resulting automation, I am not prompted to save the automation when changing the state of a boolean. I have to go and manually change some other field (say, a text field) before the save button appears. Is this the expected behavior?
example blueprint: https://gist.github.com/aderusha/e4348da4790af6d0875d2b3baa1762ac
now that i look into it, this has to be a bug. saving isn't working at all on that example blueprint (and also isn't on my own, actual blueprints). Toggle the booleans all you want, you'll never get a save button. Change the text and you will get a save button, and the new text will be saved, but the boolean state (even if changed), does not get saved.
Filed a bug report with steps to replicate. Behavior is observed on 3 different installations. https://github.com/home-assistant/core/issues/75263
I've seen it also, but thought it was just me.
Just for fun I've been walking back versions on one of my dev instances, seeing similar behavior in 2022.04. Haven't gone back further than that.
Are you able to re-create the behavior using the process shown in the report? Trying to figure out if it's just me.
There are a couple of weirdnesses when it reloads the cache or not. Like change the title it won't reload, so you have to touch the description and then it reloads, that kind of thing.
I worked with someone else that had an issue like this with booleans and I thought he also put a case in, but I haven't found it.
This maybe... https://github.com/home-assistant/frontend/issues/12542
Bit different but it was what I was remembering, in case it helps.
It's probably going to move to the frontend
What kind of actions do you use to turn off a motion light?
Turn off the breaker, cut the wire, turn the switch off, paint it black, un-install it, hit it with a hammer.
I'm sorry but that is like asking how to get eggs home from the market. With no details, there is no good answer.
What is controlling it now?
date the CEO of the local power utility until you can get access to their credentials to shut down the power grid
Hack a space laser to cut the power wires into your neighborhood.
I'm trying to edit the default motion lights blueprint in order to activate/deactivate motion based on an input bool. https://bpa.st/DWTA - I added the condition and it works fine for the first part. The other challenge is when the lights were already on and the input bool turns off, basically in the time it's waiting for a trigger. How can I keep the lights on? what's the best way to achieve that?
Use the Boolean to turn it on, but use a timer to turn it off. The timer could be reset by the boolean so if the boolean stays on, it could hold the light on. But once the boolean is gone, the timer lets it drop.
Not sure if that fits your case, but it's one way to do it.
https://www.home-assistant.io/docs/scripts/#wait
I don't follow. Right now, lights turn on by boolean and they stay on as long as there is motion and then turn off when there is no motion even if the boolean is on
I guess I don't know what you are asking. You asked to keep it on longer, I thought.
no, my main issue is not turning off the lights after the boolean is off later. Meaning that the action(s) after wait_for_trigger not execute once the bool is off
OK, just turn the lights off when the boolean goes away.
It's just another automation or another trigger on this automation.
also boolean inputs are probably broken right now
yeah, I was trying to put it all in the blueprint, without an extra automation
My suggestion is look at what the blueprint is doing you can get clear copy-paste bits out of the traces, BTW... Use that to build an automation. add the extra trigger and choose or whatever to turn the light off with the boolean. then either just use that, or if you plan on sharing it or using it in more places, convert it back to a blueprint. See the pins... 📌