Could someone create a specific automation as a learning tool for me?

I’ve been struggling for a couple of weeks to get my head around creating automations. I’ve done lots of reading, watching youtube videos, I just cant get off the starting block. Every attempt I’ve made just never works.

I learn best when I have a simple working version of something that I can play with.

At this point it would be really helpful if someone could create an automation using just the UI (no Yaml codeing, no templates, no scripts etc), I’m trying to learn the basics

I have a Minoston MP31ZP plug I’m using to learn and test with. Here’s the behavior I’m looking for.

When the amps are .3 or greater for 2 minutes (since this is a test) then turn off the MP31zp, wait 15 seconds and turn the MP31ZP back on.

Again, what would help a lot is an exact automation from someone that has this exact model plug. This should allow me to duplicate it in my system and then try different things with it to learn what works and what does not.

Thanks so much in advance.

  • What is the plug’s entity_id?

  • Does the plug report current as one of its attributes or via a separate sensor entity?

If you’re unable to answer those questions, then is the plug represented by a device in Settings → Devices & Services → Devices?

It’s common to share automations on the community forum in YAML format. You copy-paste the YAML into the Automation Editor while it’s in YAML mode, then simply change the Editor mode to Visual to see all the steps.

1 Like

I’m new to using Home Assistant, and what I’ve been doing is using ChatGPT to generate yaml code for automations then I paste that code into the code editor for an automation. Then I switch the automation back to visual editor mode so I can see the equivalent function for the UI. I was surprised how well ChatGPT is able to generate automation code.

Hi,

Yes it does show an amp value in ha. But im really hoping someone that has the exact model plug could build the automation and either send ito me or give screenshots of every element of the automation so i can duplicate it.

Ive spent so many hours yrying to build ehay i think should be a simple first (test) automation that im concerned my ha install or hardware could have a problem. Since im bery new to ha i dont have the experience yet to know if i have a hardware or system problem.

The best next step for me would to have an exact, wotking, ui created automation. If that dosent work then i have some system problem. If it does work then its my inexperience and i can use it to learn from.

Im hoping someone out there can give this help.

Thanks

Unfortunately that doesn’t answer any of my questions.

If you’re unable to provide information needed to assist you then, yes, you will have to wait for that one person who has the exact same device and has the time to post multiple screenshots because of your rules for how to teach you.

Good luck!

Go to the device panel and find your plug - it will look something like this:

You should have the entry for the Current Sensor somewhere - click on it to see the graph and click on the cog to see the details of the sensor.
image

Then copy the Entity ID and show it here - do the same for the actual switch Entity ID.
We can take it from there!

Hello Profile - clairdrummer - Home Assistant Community,

I’m sure that can be done. Also having someone or something writing it for you means the second it misbehaves, you will be struggling back to find someone to fix it for you.

The best way to learn is to just try. Run thru the docs on getting started with the automation editor. If you get stuck, come back with what you have done.

Start with a flowchart on paper. I want to look for x to happen, when it happens I want to do Y,
In your case and assuming entry level, you want 2 automations. One to turn the thing on and another to turn it off.

and
The Home Assistant Cookbook - Index.

How to help us help you - or How to ask a good question.

1 Like

I think this is what your asking for…

sensor.mini_plug_with_power_meter_testing1_electric_consumption_a_2

Just in case. Heres the info on the device.

What’s the Entity ID of your Switch/Control Entity?

I hope this is what you want… your getting close to the edge of my know how … :slightly_smiling_face:

switch.mini_plug_with_power_meter_testing1_2

This would be the YAML as the GUI creates it - once you saved it as an automation called ‘Automation Test’:

alias: Automation Test
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.mini_plug_with_power_meter_testing1_electric_consumption_a_2
    for:
      hours: 0
      minutes: 2
      seconds: 0
    above: 0.3
conditions: []
actions:
  - action: switch.turn_off
    target:
      entity_id: switch.mini_plug_with_power_meter_testing1_2
    data: {}
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
  - action: switch.turn_on
    target:
      entity_id: switch.mini_plug_with_power_meter_testing1_2
    data: {}
mode: single

Untested, obviously :wink:
Equally obvious: I can’t show you the GUI version because I don’t have entities with those names.
Give it a whirl!

FYI
Typo in switch.turn_o0

1 Like

PROGRESS!!!

It turned off but didnt turn on…the on command in the yaml is worded oddly (what the heck do I know)… is that on command correct?

No, it’s not. See my post above yours; the command has a typo.

It should be switch.turn_on

BTW, the information you provided afterwards is exactly what I had requested. The process of sharing the automation, as YAML, is also exactly what I had described.

Congratulations for making progress on learning how to provide requested information and for copy-pasting YAML code (as opposed to viewing screenshots of an automation). It’s a big step forward and will help you with future questions.

Just checking if you’re paying attention :stuck_out_tongue_winking_eye:

No, sorry, fat-fingered it :frowning:
Corrected it now :+1:

1 Like