This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Closed
Copy flows
This discussion has been closed.
Comments
https://github.com/athombv/homey/issues/443
Export all your flows and import one as copy.
The app is pending approval, will make a example this evening,
Apple is published here.
https://github.com/Dijker/nu.dijker.HomeyPSCLI
If you are not afraid of using Powershell command line on Windows , go ahead!
With my powershell module should be two commands.
If you have my module installed:
In the Picture I omitted the -Bearer for the Connect-Homey as it is already configured on my system.
You can also specify -RestoreToRoot to have the copy not in the same folder,
or specify -OverwriteFlow for Import-HomeyFlow if you have done a good export and F*ck-up the flow and want to restore your previous export.
Download the zip and extract the HomePSCLI folder with the to files to your local modules directory.
Have phun!
powershell modules have name.psd1 and name.psm1 files:
http://ramblingcookiemonster.github.io/Building-A-PowerShell-Module/#the-ingredients
Just one quick question, Export-HomeyConfig works (I can see flows being exported to the right folder), but the cmdlet ends with this:
Is that important?
Basic idea has a lot in common with Candy app. What do you think to move all Homey communication to Candy app, consolidate requests/responses and expose it in api.js?
Then if internal functionality changes (like in 0.10) all apps depending on api would work without requiring changes..
Yes, Thanks for reporting!
Was it only during the first Export-HomeyConfig? or also the second or third time wile keeping the first export and just running again.
Was it the App version from the App Store or an older direct from the Github?
Do you have a full folder structure with 4 foders below the export directory and 4 files (and possibly many folders and files below them)? like this:
Didn't see it here, I will have an look. Thanks for reporting!
But for now they work on stability and other top priorities (Bluetooth, Apps like IFTTT, etc) And I think that is OK!
For now I fill my time and do my things with Powershell.
I know it is far from what I want to learn to Emiles mother ;-)
But for now: Enjoy Powershell if you like...
The good News for you: PowerShell is open Source !!! Get it om the Mac ;-)
https://blogs.msdn.microsoft.com/powershell/2016/08/18/powershell-on-linux-and-open-source-2/
.... Just kidding,
I know Powershell is not for everyone,
If you can do things in Candy App inspired by my app.... Great ! do IT! no problems. (Copy a flow? )
I will still try to keep up with the api' s and where possible I want to use Apis from apps.
fe, for the bug that some variables from Better Logic disappears I created a incremental import/restore ;-)
I will make an example of that also in my App Thread!
And Yes, If you expose an api to do things easier .... I like to integrate them in my Powershell Module!
Thanks for your support!
I will be mostly offline a couple of days, bat after that we will have contact here and on slack?
The app was installed from the store (two days ago)
You only get one file each time and it stops with that error.....
Are all Flows exported to the folders below your folder named "Flows" ?
I guess the export of Flows in 1 flow per file fails.
In your other example you use $allFlows = Get-HomeyFlows
I guess without problems?
Can you test the following:
test Export-HomeyConfig again, as that fails after that in the same session,
test the following command:
$_FlowsJSON = Export-HomeyFlows
I guess that fails again....
After creating the Folders*.json I call
$_FlowsJSON = Export-HomeyFlows
Maybe Your Homey contains some for me unexpected info in the Flows you created where Powershell gets looping.
Can you change Line 525 in the module from
$_FlowsJSON = Export-HomeyFlows
to $_FlowsJSON = Get-HomeyFlows
Next command in the moddule is
$_FlowsJSON | ConvertTo-Json -depth 99 | Out-File -FilePath "$_HomeysExportPath\Flows-v$_HomeyVersion-$_ExportDTSt.json"
after that you should be able te run Export-HomeyConfig without problems....
Can you send met the latest Flows-*.json and Folders*.json ?
Maybe there are flows in non-existent folders...
I prefer to get them at Slack as an attachment in my PM.