API and documentation (and dummy counter issue)

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
User avatar
wizjos
Posts: 78
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

API and documentation (and dummy counter issue)

Post by wizjos »

Dear all,

Recently I've been messing around with the moonphase script published on the forum. Nice one! To get it working i've added a dummy switch, type counter (simple). I noticed some odd behaviour. Although the counter is perfectly updated with the moonage (in days) the value in the upper right corner of the title is not following the moonage, but is counting all by itself it seems. Could someone please explain me how this calculation takes place? To me it seems random...

However, I've discovered the custom switch. Way better than the abovementioned. You can even change the icon! Since this is possible from within the Domoticz GUI, I wondered if there is any api-command that lets you alter the custom icon. This set me off on a journey in the wiki, where I noticed that the documentation regarding the api-commands seems to be a bit lacking behind. When strolling across the page you gradually become aware of the possible api-calls. In my opinion it would be nice to have a more structured oversight of the diverse calls one can make. Due to the absence of an overview, I was left wondering if the calls mentioned there are all that are available...
For instance, I was unable to find anything regarding the changing of an icon (my aim is to change the icon with the changing of the phase of the moon), so does this mean it not (yet) possible, or is it not documented yet? If not possible yet, is there a chance this will be implemented in the future? If it is already possible, then how do I do it?

Regards,
Wizjos
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: API and documentation (and dummy counter issue)

Post by Egregius »

Use the developer console of your browser to find out the commands and add them to the wiki ;)
naitsirhc
Posts: 44
Joined: Sunday 17 January 2016 11:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: API and documentation (and dummy counter issue)

Post by naitsirhc »

I have to follow this topic.....I love to have it in my frontpage

Unfortunatly I have the skills to program it myself, so I have to borrow it :D
Und Tschjuß
User avatar
wizjos
Posts: 78
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: API and documentation (and dummy counter issue)

Post by wizjos »

Thanks Egregius! You sent me in the right direction. There is not an api call available but by using the developer console I found a JSON call: json.htm?type=setused&idx=132&name=Maanfase&description=&switchtype=0&customimage=103&devoptions=1;dagen&used=true

I've used it succesfully in my moonphase script
groovy
Posts: 17
Joined: Sunday 23 October 2016 11:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: API and documentation (and dummy counter issue)

Post by groovy »

Just found this thread.
I'm able to change the icon of my custom sensor with this JSON-call. But the icon doesn't change immediately, only after a page reload.
Is there a way to force a reload of the icon without reloading the whole page?
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: API and documentation (and dummy counter issue)

Post by freijn »

Started to use the dummycounter recently and noticed the same.

In the utility page the top line it updated perfectly in the dashboard page its not.

I have also seen the topline is updated a little slower than the totals in the counter window itself.

Very interesting topic. :-) And yes.. documentation is everything!
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 0 guests