So I am new to HA after being an ST user and I am trying to get my head around what feels like super complex processes for something I previously found a breeze to setup.
I have some Greenwave ZWave Plugs (UK), there is a post on here already about the issue where it flashing a green light when it receives no communication after x time.
Min 2 and max 255 mins.
The post mentioned about using a ping command, however it stats this has been changed to a push instead.
That’s fine, but I’m getting a little frustrated as I navigate through many help topics which only ever partially answer the solution.
The example on the original post was “here is some code to resolve the issue and pings it every hour”
That’s fantastic,
So how do I make that code an automation.
I’ve tried so many options to try and get the pin automation using the gui to get it to trigger a ping to the plug every hour and I can not for the life of me work out what is going wrong.
But when I compare the code it shows no intent or obvious target to the trigger for the automation.
I presume the trigger is choosing hour often it should run.
Please be aware I am new to this and I really need to hunt down answers that are guiding me through the process and not just. Here is some code.
I really don’t want to hand in the towel with HA as I’ve spent a chunk on new equipment for this but I’m already pulling my hair out and I’ve not even started digging into how I run the ST equivalent or “goodnight scene” putting the house in night mode etc. good morning for day mode.
I’m starting to think this might be many hours of work for something that took 5 mins in ST lol.
It should be a literal copy/paste (without the ID line and removing the fist 2 spaces in each row before pasting) but with your device_ids. Do you know how to find them?
No it won’t be a simple copy paste for that code. It will have to be modified.
The ZWaveJS ping service was depricated in favor of a ‘button’ implementation earlier this year. So instead of a ‘ping’ call like in that code, you have to issue button.press to the corresponding button.[devicename]_ping (or something like that, I’m doing this from memory)
Theres a couple posts here about pinging dead ZWave nodes. Look at the end of those posts, the recent scripts have the fixed code.
Also. Welcome. It will get easier. It will suck for a while as you learn but it will be worth it.
It’s an automation. See the trigger? Scripts don’t have a trigger. Scripts are a sequence of actions that are run when you start them manually (like in the UI) or call them from some other automation/script as an action.
Automations are basically scripts with one or more triggers. They run a set of actions when one of their triggers fire. They can also be run manually from the UI but generally that’s only for debugging.
So you can almost paste it in there. The code above is shared in a way that makes it easy to paste into your configuration.yaml file under the automation key. If you add a new automation from Settings → Automations and switch to code view you’ll have to tweak it to paste there. Couple issues:
id is generated for you when you use the automation editor. Don’t paste that in or you’ll create a conflict with the already generated one
In the automation editor’s code view you’re only looking at the one automation. So the entire thing is a single YAML object/dictionary. Notice how in the code above it the entire thing starts with a - signifying that it is an item in a list. You have to remove that, it will cause an error if you leave that in when pasting into the code view of the automation editor.
Also as noted above device ids are unique to each HA instance. Copying and pasting those won’t work. You have to get the ones for your devices. Use the automation editor in the normal view (not code view) and select your devices.
This is my original code, as mentioned the ping was depreciated so now use the refresh values action, so I have amended the automation, you would need to put your devices in there.
Ahh Mannnnn. Thanks all, I have been pulling my hair out on this one. I was kind of on the right lines with the time_pattern but I just never seemed to trigger, although I was trying to do the wrong action after all this.
@cleggton I have setup as this, I run it and tadaa it stopped flashing
But with the example, I presume this will run every 5 minutes ?
As I am sitting here watching and the last trigger remains at the time a run in manually.
This was the issue I have been getting where the time_pattern seems to not continue as per the time span etc.
I am looking at the automations section and the “last triggered” never seems to change.
If I click on the More Information this confirms the last trigger was when I setup this and run it manually. 21:05 (UK) Time.