curl -X POST -H "Content-Type: application/json" -d {"staircase":{"segment-delay-ms":1000,"on-time":10}} 192.168.142.63/json/state
curl: (3) URL using bad/illegal format or missing URL
the triggers simulators do work
curl -X POST -H "Content-Type: application/json" -d '{"staircase":{"bottomsensor":true}}' 192.168.142.63/json/state
I think this is the json for the usermod (from the srg74 fork for the wemos shield:
{
“state”: {
“staircase”: {
“enabled”: true,
“segment-delay-ms”: 150,
“on-time-s”: 5,
“bottom-sensor”: false,
“tops-ensor”: false
},
}
Note the difference with on-time-s?
And if that does not work:
curl -X POST -H “Content-Type: application/json” -d ‘{“staircase”: {“segment-delay-ms”: 150,“on-time-s”: 5},}’ 192.168.142.63/json
References:
I think is the “/json/state” that was causing problems as that returns the current state.
If you noticed (I am sure you did), the first one is the correct syntax.
Run that one again with different time values. Then read it back using the /json/state curl command. Does it show the new values?
I am so sorry I did not think to look there first, but the readme.md file states the json available from the JSON API is this:
{
“state”: {
“staircase”: {
“enabled”: true,
“bottom-sensor”: false,
“top-sensor”: false
},
}
The reason your time values are not being accepted and used is they are calculated from constants set in the usermod programming.
You can manually set the constants, or contact the usermod creator and ask them to add additional json api support, or code it yourself and submit a pull request (so your changes get incorporated for everyone and you can update firmware more easily in the future.
Does this mean the parameters work in the provided usermod, but not in the provided pre-compiled .bin provided by someone else? If so, hopefully you reached out to them to alert them of the outcome of this thread/topic