Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

"method, PUT, not available for resource ..." #2

Open
JJJ opened this issue Aug 19, 2019 · 1 comment
Open

"method, PUT, not available for resource ..." #2

JJJ opened this issue Aug 19, 2019 · 1 comment

Comments

@JJJ
Copy link

JJJ commented Aug 19, 2019

Hey there, I know this repo is no longer maintained, but figured I'd create this issue for anyone brave (or silly) enough (like me) to give it a try anyways.

This repo does a great job at backing everything up. See:

Screen Shot 2019-08-19 at 6 30 55 PM

Unfortunately, the Hue Bridge API does not appear to offer an endpoint for POSTing (creating) new lights, which is the very first step to restoring a Hue Bridge to later create groups, scenes, etc....

Speculating, but it seems that the only way to do a restore, is to:

  • reset your old bridge (and all of the lights and accessories connected to it)
  • add your lights (maximum 10 at a time) to the new bridge
  • attempt to run the restore command

I think this is because the Hue Bridge API works the way it does, and because the code in this repository expects to use the PUT action, which only works on existing resources (the POST action is used for creating new ones.)

I have a v2 Bridge that is failing intermittently, and have a new v2 switch. I was hoping this would be simpler, but the Hue Bridge API does not appear to make it so. The code in this repo goes a long way towards automating things, but I find myself stuck at step 0 for now. If I find any success later, I'll update this issue.

Thanks @klutchell for your efforts here 👍

@klutchell
Copy link
Owner

Nice investigation. I had a quick look at the code and the API to confirm your findings and you are correct. In fact, I must have already known this since I have test cases in test.js to confirm that PUT would fail for lights and groups.

   restore lights
myApp putting 1/2 lights to http://0.0.0.0:9000/api/newdeveloper/lights
sim 127.0.0.1 - - [21/Aug/2019:11:51:29 +0000] "PUT /api/newdeveloper/lights HTTP/1.1" 404 36 "-" "-"
myApp Cannot PUT /api/newdeveloper/lights
    ✓ simulator will reject PUT (393ms)
myApp 

  restore groups
myApp putting 1/1 groups to http://0.0.0.0:9000/api/newdeveloper/groups
sim 127.0.0.1 - - [21/Aug/2019:11:51:29 +0000] "PUT /api/newdeveloper/groups HTTP/1.1" 404 36 "-" "-"
myApp Cannot PUT /api/newdeveloper/groups
    ✓ simulator will reject PUT (392ms)
myApp 

If you come up with a workaround let me know. For now I'll append your restore steps to the readme in case anyone else is still trying to use this project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants