[Solved] Transfer data file to Windows

I keep running logs for my weather station and my water heater, using the Append action.

Once a day, at Midnight, I would like to transfer the file to Windows and reinitialize the file for the next day.

Is there a way under RM give the file a new name and move it to Windows?

I think you would have to write a script to use the file manager endpoint to copy the file to your pc/nas/server etc and alter the date name in the script. There isn't anything in RM that I know of that could do that.

From Windows, I can issue the command:

curl -XGET "http:/192.168.0.248/local/WaterHeater.csv" > "D:\Application Data\Hubby\AA_WH.csv"

which will get me a copy of the file.

I now need a way to send a signal to HE from Windows that triggers an App in HE to reset the file.

Is there anything I can do in Windows that will trigger an action in HE?

Yes. There are at least two built-in approaches that rely on using curl at the Windows end.

  1. Setup a virtual switch in Hubitat. Expose it to MakerAPI. Send an HTTP GET from Windows to change the state of the switch from off to on. On Hubitat, when the state changes, trigger an automation that does what you want to the file. That same automation should also reset the state of the switch. Read more in the Maker API documentation:
    Maker API | Hubitat Documentation
  2. Use Rule Machine. As the trigger, use "Local End Point". Use the URL that is generated for that trigger in curl. The actions of that rule should do whatever automations you need performed. Read more in the Rule 5.1 documentation under "Local End Point":
    Rule 5.1 | Hubitat Documentation

Previously, I have preferred the first of the two because I had automations setup without using Rule Machine. But, it is probably the better approach for your needs.

5 Likes

Interesting I had to use curl.exe, without the -XGET or it failed, on Windows

I used option #2 and it worked great. I had no idea what an End Point was until now.

1 Like