Page 1 of 1

JSON API for timers

Posted: Friday 05 March 2021 19:48
by Number8
Hello,
It seems to me that the Wiki does not document the API that return all the timers for one specific device.
I'm currently using

Code: Select all

http://IP/json.htm?idx=IDX&type=timers
for selector switch
and

Code: Select all

http://IP/json.htm?idx=IDX&type=setpointtimers
for setpoint switch

There are 28 different timer types. Only the first five are documented
https://www.domoticz.com/wiki/Domoticz_ ... 8timers.29

It seems to me there is some kind on inconsistency among timers API.
http://ip/json.htm?type=schedules
returns a TimerType value and a TimerTypeStr value, whereas the API that returns all timers for one specific device (see above) returns a Type value which makes it kind of easier to process since it is not dependant of string characters and everything is coded in one field.

One last thing, dzVents supports a subset of the 28 timer timer types. Is it something that could be improved in the future?
Thank you very much

Re: JSON API for timers

Posted: Friday 05 March 2021 20:07
by waaren
Number8 wrote: Friday 05 March 2021 19:48 Hello,
It seems to me that the Wiki does not document the API that return all the timers for one specific device.
I'm currently using

Code: Select all

http://IP/json.htm?idx=IDX&type=timers
for selector switch
and

Code: Select all

http://IP/json.htm?idx=IDX&type=setpointtimers
for setpoint switch

There are 28 different timer types. Only the first five are documented
https://www.domoticz.com/wiki/Domoticz_ ... 8timers.29
The wiki is maintained by forum members like you and me. If you find something missing or that could be improved please feel free to ask me (via PM) for a wiki user account so you can add the missing information. Together we will make the wiki better !
One last thing, dzVents supports a subset of the 28 timer timer types. Is it something that could be improved in the future?
Thank you very much
I am not sure I follow your line of thinking here. Can you please elaborate on this. Thx!

Re: JSON API for timers

Posted: Saturday 06 March 2021 7:23
by Number8
The wiki is maintained by forum members like you and me. If you find something missing or that could be improved please feel free to ask me (via PM) for a wiki user account so you can add the missing information. Together we will make the wiki better !
Done
I am not sure I follow your line of thinking here. Can you please elaborate on this. Thx!
Yes sorry not very clear. In dzVEnts time events related to Twilight are

'xx minutes before civiltwilightstart', --
'xx minutes after civiltwilightstart', -- Please note that these relative times
'xx minutes before civiltwilightend', -- cannot cross dates
'xx minutes after civiltwilightend', --

Would be great to have those related to Nautical Twilight and Astronomical Twilight as well
Thanks

Re: JSON API for timers

Posted: Saturday 06 March 2021 8:39
by waaren
Number8 wrote: Saturday 06 March 2021 7:23 'xx minutes before civiltwilightstart', --
'xx minutes after civiltwilightstart', -- Please note that these relative times
'xx minutes before civiltwilightend', -- cannot cross dates
'xx minutes after civiltwilightend', --

Would be great to have those related to Nautical Twilight and Astronomical Twilight as well
OK, Understand now and will have a look if it can be implemented without too much impact on response times.

Re: JSON API for timers

Posted: Saturday 06 March 2021 8:44
by Number8
Thanks
Wiki account activated
Have a nice day

Re: JSON API for timers

Posted: Saturday 13 March 2021 20:09
by Number8
waaren wrote: Saturday 06 March 2021 8:39
Number8 wrote: Saturday 06 March 2021 7:23 'xx minutes before civiltwilightstart', --
'xx minutes after civiltwilightstart', -- Please note that these relative times
'xx minutes before civiltwilightend', -- cannot cross dates
'xx minutes after civiltwilightend', --

Would be great to have those related to Nautical Twilight and Astronomical Twilight as well
OK, Understand now and will have a look if it can be implemented without too much impact on response times.
Thanks for this nice addition in the lastest beta