Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST endpoint JSON {"status": true} not working as of 1.9.0 rc6 and above #476

Closed
coehn1 opened this issue Jun 14, 2019 · 5 comments · Fixed by #477
Closed

REST endpoint JSON {"status": true} not working as of 1.9.0 rc6 and above #476

coehn1 opened this issue Jun 14, 2019 · 5 comments · Fixed by #477

Comments

@coehn1
Copy link

coehn1 commented Jun 14, 2019

Hi,

I use diyHue to control my MiLights through the Hue app.

diyHue sends comands to the REST /gateways endpoint.

To toggle the lights on/off diyHue uses:
{"status": true} and {"status": false}

As of 1.9.0 rc6 this doesn't work anymore. The false/off stae works but the true/on doesn't work anymore. I've tried these firmware version:
1.8.8 -> workst
1.9.0 rc4 -> workst
1.9.0 rc5 -> workst
1.9.0 rc6 -> doesn't work
1.9.0 rc7 -> doesn't work
1.9.0 rc8 -> doesn't work
1.9.0 rc8 -> doesn't work
1.9.0 -> doesn't work
1.9.1 -> doesn't work

Could you please check this.

@sidoh
Copy link
Owner

sidoh commented Jun 14, 2019

That was the ArduinoJson v6 upgrade, I think.

Can publish a fix.

@Hypernova007
Copy link

There is still an issue with the status command:
On version 1.9.2 (nodemcuv2):

  • {"status": true} and {"status": false} are working
  • {"status": on} and {"status": off} are not working

@sidoh
Copy link
Owner

sidoh commented Jul 20, 2019

{"status":on} and {"status":off} are not valid JSON.

Try {"status":"on"}.

@Hypernova007
Copy link

I wrote it wrong on this forum, but in my code it is {"status": "on"} and {"status": "off"} . I apologise.

I did some more investigation: {"status": "off"} is also working in version 1.9.2
But {"status": "on"} is not working in version 1.9.2

@sidoh
Copy link
Owner

sidoh commented Jul 20, 2019

I'm not able to reproduce. Works fine for me on 1.9.2 and 1.10.0-dev.7.

$ curl -X POST -H 'content-type: application/json' -d '{"status":"on"}' 10.133.8.194/gateways/0x118d/rgb_cct/1
{"status":"ON","level":100,"hue":240,"saturation":41,"bulb_mode":"color"}%

$ curl -X POST -H 'content-type: application/json' -d '{"status":"off"}' 10.133.8.194/gateways/0x118d/rgb_cct/1
{"status":"OFF","level":100,"hue":240,"saturation":41,"bulb_mode":"color"}%

$ curl 10.133.8.194/about
{"firmware":"milight-hub","version":"1.9.2","ip_address":"10.133.8.194","reset_reason":"Software/System restart","variant":"d1_mini","free_heap":22192,"arduino_version":"2_4_2"}%

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

Successfully merging a pull request may close this issue.

3 participants