Page 1 of 1
How to get current state of device for custom website
Posted: Wednesday 04 August 2021 22:09
by LordMax
Hi!
I am making a home controller where I want to have a small domoticz controller imlemented. I have a fully working domoticz server but I cannot figure out how to get the current state of a switch. How do I do that? Thanks beforehand!
Best regards Max
Re: How to get current state of device for custom website
Posted: Wednesday 04 August 2021 23:04
by waltervl
You can get the status of a domoticz device with a http Json API call.
https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s
But as your question is a little bit vague for me you better explain in more detail what you want to achieve.
Perhaps a floorplan
https://www.domoticz.com/wiki/Floorplans
or the dashboard can also be good enough for you.
https://www.domoticz.com/wiki/Managing_ ... #Dashboard
Re: How to get current state of device for custom website
Posted: Thursday 05 August 2021 0:09
by LordMax
Thanks! I was late editing this post but I managed to solve this myself but it via the wiki. I read the status from the json file and now it works!
Re: How to get current state of device for custom website
Posted: Thursday 05 August 2021 0:33
by waltervl
Great, in your PM you asked for the security status. That you als get with a http API cal:
https://www.domoticz.com/wiki/Domoticz_ ... rity_state
PS I do not answer donoticz related questions in PM as other people can not learn from it. Also there are no stupid questions so everything can be asked and answered on the forum

Re: How to get current state of device for custom website
Posted: Friday 06 August 2021 16:28
by LordMax
Ok! I wasnt sure if I could make a new post out of it, Ive posted a lot lately but I appriciate the help so much on this forum!

. Now I am just trying to make a highcharts on my home controller from the /json.htm?idx=xxx&range=day&sensor=temp&type=graph JSON file. But I am having a hard time formatting the JSON file so that the graph looks like it does in domoticz. Any help would be very appriciated

. Thanks beforehand!