Dimmer JSON url add a '+1' in 'data' - How?

Moderator: leecollings

Post Reply
SoerenBM
Posts: 34
Joined: Tuesday 22 March 2016 19:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5169
Location: Denmark
Contact:

Dimmer JSON url add a '+1' in 'data' - How?

Post by SoerenBM »

Hi all,

I have Domoticz running on an RPi and am new to Domoticz. Currently I'm only using virtual hardware and devices to receive JSON commands from my home automation system (LK IHC via a middleware component called IHC Captain) that keeps Domotics updated with the correct status from the LK IHC controller.

My LK IHC dimmers needs 0-100%. It is working fine except Domoticz is always 1% low compared to the dimmer - ie. 50% on the dimmer = 49% in Domoticz - 0% in dimmer = off and Domoticz needs 1% = off.

There has been reported an issue regarding this:

viewtopic.php?f=6&t=10972

Tom, that has reported this issue has a workaround by adding "+1 in data".


But how the does he do that. I have not been able to find information about "json api data"


The URL used to update status in Domoticz

'http://192.168.10.11:8080/json.htm?type ... el=[newval]'


Can anyone guide me in adding a +1 to the "set level"

Sorry if I'm way off and this is not even possible. :)

BR Søren
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Dimmer JSON url add a '+1' in 'data' - How?

Post by Egregius »

Depends on the language used in the script.
In PHP that would be
$newval = $val + 1;

But there should also be a check of the value. Otherwise 0 will also be 1.

$val>0 ? $newval = $val +1 : $newval = $val;
SoerenBM
Posts: 34
Joined: Tuesday 22 March 2016 19:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5169
Location: Denmark
Contact:

Re: Dimmer JSON url add a '+1' in 'data' - How?

Post by SoerenBM »

Hi,

Thanks for your reply.

I'm not using a script. I'm just using the JSON API url:

'http://192.168.10.11:8080/json.htm?type ... el=[newval]'

Can I put a '+ 1' in the URL somehow?

I am not familiar with scripting in general so forgive my ignorance. Both Domoticz and scripting is new to me.

Are you saying I should use a script instead of the JSON API URL?

Thanks :)

BR Søren
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Dimmer JSON url add a '+1' in 'data' - How?

Post by Egregius »

I think you should do it in the IHC captain.
Or put a script in between to do the calc.
SoerenBM
Posts: 34
Joined: Tuesday 22 March 2016 19:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5169
Location: Denmark
Contact:

Re: Dimmer JSON url add a '+1' in 'data' - How?

Post by SoerenBM »

Okay, thanks.

I don't think it is possible to do it in IHC Captain.

A script in between, are you think of a LUA script in Domoticz? Just need to figure that out :)

BR Søren
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Dimmer JSON url add a '+1' in 'data' - How?

Post by Egregius »

If I understand correctly it's IHC Captain that calls the JSON url's so Domoticz knows what's going on?
Does the IHC Captain has it's own API?

But, if IHC is the main controller, why is it so important that Domoticz know everything? Why do you want 2 systems in parallel?
SoerenBM
Posts: 34
Joined: Tuesday 22 March 2016 19:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5169
Location: Denmark
Contact:

Re: Dimmer JSON url add a '+1' in 'data' - How?

Post by SoerenBM »

Yes, that is correctly understood. IHC Captain can "see" the changes in the IHC Controller and based on this change call an URL. So if I turn on a light/lamp on a physical switch that is connected to the IHC Controller > IHC Captain sees this and call the JSON > and the light/lamps turns on in Domoticz so the two systems are in sync.

Ahmm... No, I don't think IHC Captain has its own API. It is one guy who has developed it in his freetime.

Yes, 'LK IHC Controller' is currently the main controller. But I would like to switch/have Domoticz become the main controller as it will open for the possibilities to use different technologies like z-wave, rfxcom etc. IHC Controller is a proprietary system and the development has sadly almost stopped completely.

BR Søren
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Dimmer JSON url add a '+1' in 'data' - How?

Post by Egregius »

If the IHC controller has an API I would turn it around and make Domoticz the master. I did that in the beginning. Domoticz master with a homewizard as slave (before I had the RFXcom). Afterwirds I replaced everything with Zwave stuff and found finally a solution that's stable and reliable.
SoerenBM
Posts: 34
Joined: Tuesday 22 March 2016 19:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5169
Location: Denmark
Contact:

Re: Dimmer JSON url add a '+1' in 'data' - How?

Post by SoerenBM »

Unfortunately the IHC Controller do not have an API (not officially) that is why IHC Captain was develop (reverse engineering) to make things easier.

Yes, my goal is to make Domoticz the master controller but the IHC Controller/installation is an integrated part of my house with cabling etc. so I will have to "make" them talk together via IHC Captain.

I already bought an RFCtrx433E for Domoticz that will be controlling my Somfy blinds that will be mounted tomorrow.

In the future I'm planning to get z-wave components when expanding the system.

Br Søren
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest