Skip to content

Commit

Permalink
* Support for Nefit Easy thermostat (SetPoint)
Browse files Browse the repository at this point in the history
* Fixed problem with the new device table otherdevices_scenesgroups_idx.
  • Loading branch information
dannybloe committed Oct 17, 2016
1 parent 9effa5c commit bdb5161
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ You can control this fetching in the [settings](#settings).
- **hardwareId**: *Number*. See Domoticz devices table in Domoticz GUI. Only available when [http fetching](#fetching-http-data) is enabled.
- **hardwareType**: *String*. See Domoticz devices table in Domoticz GUI. Only available when [http fetching](#fetching-http-data) is enabled.
- **hardwareTypeValue**: *Number*. See Domoticz devices table in Domoticz GUI. Only available when [http fetching](#fetching-http-data) is enabled.
- **heatingMode**: *String*. For zoned thermostats like EvoHome. Only available when [http fetching](#fetching-http-data) is enabled.
- **humidity**: Only when applicable.
- **id**: *Number*. Id of the device
- **lastUpdate**:
Expand All @@ -416,9 +417,8 @@ You can control this fetching in the [settings](#settings).
- **rainLastHour**: Only when applicable.
- **rawData**: *Table*: Not all information from a device is available as a named attribute on the device object. That is because Domoticz doesn't provide this as such. If you have a multi-sensor for instance then you can find all data points in this **rawData** *String*. It is an array (Lua table). E.g. to get the Lux value of a sensor you can do this: `local lux = mySensor.rawData[1]` (assuming it is the first value that is passed by Domoticz). Note that the values are string types!! So if you expect a number, convert it first (`tonumber(device.rawData[1]`).
- **signalLevel**: *String*. See Domoticz devices table in Domoticz GUI. Only available when [http fetching](#fetching-http-data) is enabled.
- **state**: *String*. For switches this holds the state like 'On' or 'Off'. For dimmers that are on, it is also 'On' but there is a level attribute holding the dimming level. **For selector switches** (Dummy switch) the state holds the *name* of the currently selected level. The corresponding numeric level of this state can be found in the **rawData** attribute: `device.rawData[1]`. **For groups**, the state can be "On", "Off" or "Mixed"
- **setPoint**: *Number*. Holds the set point for thermostat like devices. Only available when [http fetching](#fetching-http-data) is enabled.
- **heatingMode**: *String*. For zoned thermostats like EvoHome. Only available when [http fetching](#fetching-http-data) is enabled.
- **setPoint**: *Number*. Holds the set point for thermostat like devices. Only available when [http fetching](#fetching-http-data) is enabled.
- **state**: *String*. For switches this holds the state like 'On' or 'Off'. For dimmers that are on, it is also 'On' but there is a level attribute holding the dimming level. **For selector switches** (Dummy switch) the state holds the *name* of the currently selected level. The corresponding numeric level of this state can be found in the **rawData** attribute: `device.rawData[1]`. **For groups**, the state can be "On", "Off" or "Mixed".
- **switchType**: *String*. See Domoticz devices table in Domoticz GUI. Only available when [http fetching](#fetching-http-data) is enabled.
- **switchTypeValue**: *Number*. See Domoticz devices table in Domoticz GUI. Only available when [http fetching](#fetching-http-data) is enabled.
- **temperature**: Only when applicable.
Expand Down
7 changes: 4 additions & 3 deletions dzVents/Domoticz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ local function Domoticz(settings)
for tableName, tableData in pairs(_G) do

-- only deal with global <otherdevices_*> tables
if (string.find(tableName, 'otherdevices_') ~= nil and tableName ~= 'otherdevices_scenesgroups') then
if (string.find(tableName, 'otherdevices_') ~= nil and
string.find(tableName, 'otherdevices_scenesgroups') == nil) then
utils.log('Found ' .. tableName .. ' adding this as a possible attribute', utils.LOG_DEBUG)
-- extract the part after 'otherdevices_'
-- That is the unprocesses attribute name
Expand Down Expand Up @@ -376,9 +377,9 @@ local function Domoticz(settings)

local function updateGroupAndScenes()
-- assume that the groups and scenes have been created using the http data first
if (_G.otherdevices_scenesandgroups) then
if (_G.otherdevices_scenesgroups) then

for name, state in pairs(_G.otherdevices_scenesandgroups) do
for name, state in pairs(_G.otherdevices_scenesgroups) do

-- name is either a scene or a group
local device = (self.scenes and self.scenes[name]) or (self.groups and self.groups[name])
Expand Down
4 changes: 2 additions & 2 deletions dzVents/QUICKREF.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ Available on the collections: devices, variables, scenes, groups:
- **hardwareId**: *Number*. Only available when [http fetching](../README.md/#fetching-http-data) is enabled.
- **hardwareType**: *String*. Only available when [http fetching](../README.md/#fetching-http-data) is enabled.
- **hardwareTypeValue**: *Number*. Only available when [http fetching](../README.md/#fetching-http-data) is enabled.
- **heatingMode**: *String*. For zoned thermostats like EvoHome. Only available when [http fetching](../README.md/#fetching-http-data) is enabled.
- **humidity**: Only when applicable.
- **id**: *Number*. Id of the device
- **lastUpdate**:
Expand All @@ -226,8 +227,7 @@ Available on the collections: devices, variables, scenes, groups:
- **rawData**: *Table*. Raw data passed by Domoticz.
- **signalLevel**: *String*. Only available when [http fetching](../README.md/#fetching-http-data) is enabled.
- **setPoint**: *Number*. Holds the set point for thermostat like devices. Only available when [http fetching](../README.md/#fetching-http-data) is enabled.
- **heatingMode**: *String*. For zoned thermostats like EvoHome. Only available when [http fetching](../README.md/#fetching-http-data) is enabled.
- **state**: *String*. For switches this holds the state like 'On' or 'Off'. For dimmers that are on, it is also 'On' but there is a level attribute holding the dimming level. **For selector switches** (Dummy switch) the state holds the *name* of the currently selected level. The corresponding numeric level of this state can be found in the **rawData** attribute: `device.rawData[1]`.
- **state**: *String*. For switches this holds the state like 'On' or 'Off'. For dimmers that are on, it is also 'On' but there is a level attribute holding the dimming level. **For selector switches** (Dummy switch) the state holds the *name* of the currently selected level. The corresponding numeric level of this state can be found in the **rawData** attribute: `device.rawData[1]`. **For groups**, the state can be "On", "Off" or "Mixed".
- **switchType**: *String*. See Domoticz devices table in Domoticz GUI. Only available when [http fetching](../README.md/#fetching-http-data) is enabled.
- **switchTypeValue**: *Number*. Only available when [http fetching](../README.md/#fetching-http-data) is enabled.
- **temperature**: Only when applicable.
Expand Down
4 changes: 4 additions & 0 deletions dzVents/dzVents history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[1.1.3]
* Support for Nefit Easy thermostat (SetPoint)
* Fixed problem with the new device table otherdevices_scenesgroups_idx.

[1.1.2]
* More robust way of updating devices.lua
* Added device level information for non-dimmer-like devices
Expand Down
2 changes: 1 addition & 1 deletion dzVents/tests/testDomoticz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('Domoticz', function()

}

_G.otherdevices_scenesandgroups = {
_G.otherdevices_scenesgroups = {
['Scene1'] = 'Off',
['Scene2'] = 'Off',
['Group1'] = 'On',
Expand Down

0 comments on commit bdb5161

Please sign in to comment.