Setpoint only adjustable by IDX? Topic is solved

Moderator: leecollings

Post Reply
Plantje
Posts: 451
Joined: Friday 16 October 2015 7:58
Target OS: Windows
Domoticz version:
Contact:

Setpoint only adjustable by IDX?

Post by Plantje »

In the wiki I read the following example:
commandArray['SetSetPoint:MySetPointIdx']='20.5'

Now, this is working just fine, but I was wondering if you NEED to use the IDX or if you can also change the setpoint by using the device name.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Setpoint only adjustable by IDX?

Post by waaren »

Plantje wrote: Thursday 26 November 2020 11:02 I was wondering if you NEED to use the IDX
The SetSetPoint command requires an IDX but you can quite easily work around that with:

Code: Select all

commandArray = {}

local tName = 'thermostatName' -- Change to name of thermostat

local function getDeviceID(dev)
    return otherdevices_idx[dev]
end

commandArray['SetSetPoint:' .. getDeviceID(tName)] = '22.5'

return commandArray
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Plantje
Posts: 451
Joined: Friday 16 October 2015 7:58
Target OS: Windows
Domoticz version:
Contact:

Re: Setpoint only adjustable by IDX?

Post by Plantje »

Thanks! That would indeed be the next step. You even created the code for me. Great!
Plantje
Posts: 451
Joined: Friday 16 October 2015 7:58
Target OS: Windows
Domoticz version:
Contact:

Re: Setpoint only adjustable by IDX?

Post by Plantje »

Worked out just fine!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest