DzVents: Make rooms available as device groups Topic is solved

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.
Post Reply
rrozema
Posts: 118
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: Delft
Contact:

DzVents: Make rooms available as device groups

Post by rrozema » Monday 02 April 2018 19:41

Domoticz has the ability to assign your devices to a room. I can not find however how to find the devices in a particular room from DzVents. Can we have the rooms available as device groups from the domotiz object? This enables us to create scripts that automatically operate on all devices in a particular room.

Ries
Posts: 33
Joined: Tuesday 01 December 2015 9:47
Target OS: Raspberry Pi
Domoticz version: 3.9639
Location: Netherlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by Ries » Monday 18 June 2018 5:18

That wuld be nice.
Version 3.9639
Platform: Jessie lite
Hardware: Raspberry pi 3B; RFXCOM; Weather Underground; Dummy; OpenZwave USB; Fritzbox Callmonitor via LAN interface; System Alive Checker (Ping); Philips Hue Bridge; Atag One Thermostat

dannybloe
Posts: 1473
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: DzVents: Make rooms available as device groups

Post by dannybloe » Monday 18 June 2018 7:19

Yes, it is already on my list. Maybe for 2.5.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

User avatar
waaren
Posts: 923
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by waaren » Monday 18 June 2018 11:35

rrozema wrote:
Monday 02 April 2018 19:41
Domoticz has the ability to assign your devices to a room. I can not find however how to find the devices in a particular room from DzVents. Can we have the rooms available as device groups from the domotiz object? This enables us to create scripts that automatically operate on all devices in a particular room.
@rrozema,

as workaround until this is implemented you can add all devices in a room to a domoticz group and loop through these devices with

domoticz.groups("group name").devices().forEach(function(device) -- loop over all devices in this group;
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

rrozema
Posts: 118
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: Delft
Contact:

Re: DzVents: Make rooms available as device groups

Post by rrozema » Monday 18 June 2018 14:24

waaren wrote:
Monday 18 June 2018 11:35
rrozema wrote:
Monday 02 April 2018 19:41
Domoticz has the ability to assign your devices to a room. I can not find however how to find the devices in a particular room from DzVents. Can we have the rooms available as device groups from the domotiz object? This enables us to create scripts that automatically operate on all devices in a particular room.
@rrozema,

as workaround until this is implemented you can add all devices in a room to a domoticz group and loop through these devices with

domoticz.groups("group name").devices().forEach(function(device) -- loop over all devices in this group;
Yes thank you for the suggestion, I use many groups already. I was however trying to avoid having to maintain all these groups: I have, like many people will have done, assigned my devices into rooms to show them correctly on the floorplan. I asked for this addition to DzVents to take advantage of these room assignments.

For example: by creating a generic script that periodically goes over all rooms, looking for rooms that have lights that are on and have one or more motion sensor(s). If there has been no motion in the room the last, say 5 minutes, I can switch off the light(s) in that room automatically. I don't need to hard code any motion sensors or switches, just add the script and it works, even if a motion sensor or a a light is added or removed. All you need to do is add it to the correct room, which you would do already for showing it correctly in the floorplan.

Note to Danny: I think, once this is added, the next question will be how to identify which devices are motion sensors, lights, etc. I'm currently using json in each device's description fields to configure settings per device. Maybe you've got some good ideas for this too?

dannybloe
Posts: 1473
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: DzVents: Make rooms available as device groups

Post by dannybloe » Monday 18 June 2018 14:26

All the type information is already on the Device object so that should not be so hard.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

rrozema
Posts: 118
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: Delft
Contact:

Re: DzVents: Make rooms available as device groups

Post by rrozema » Monday 18 June 2018 14:40

dannybloe wrote:
Monday 18 June 2018 14:26
All the type information is already on the Device object so that should not be so hard.
I may be in need of some assistance then setting up device types. For all my motion sensors (most of them are cheap neo coolcam z-wave pir devices, but i also have more expensive aeotec) are detected as normal on/off switches. If I try to switch such a device manually, domoticz responds that the device does not support being switched. So domoticz knows it is a device that can't be switched, but i haven't found a way to distinguish these sensors from switches yet.

snellejellep
Posts: 116
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi
Domoticz version: 3.97xx
Location: The Neterlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by snellejellep » Monday 18 June 2018 14:45

you can use a prefix in the name of the devices like lampxxx or PIRxxx that is what i use and then with a wildcard like PIR* you can cycle trough them
raspberry pi | xiaomi gateway/vacuum | yeelight | philips hue | zwave |ubiquiti unifi | harmony

dannybloe
Posts: 1473
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: DzVents: Make rooms available as device groups

Post by dannybloe » Monday 18 June 2018 14:47

Or use the description field and use that in your scripts.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

rrozema
Posts: 118
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: Delft
Contact:

Re: DzVents: Make rooms available as device groups

Post by rrozema » Monday 18 June 2018 14:51

snellejellep wrote:
Monday 18 June 2018 14:45
you can use a prefix in the name of the devices like lampxxx or PIRxxx that is what i use and then with a wildcard like PIR* you can cycle trough them
Yes, that is a workaround. And i do things like that. However, dzvents exposes all sorts of attributes for each device and yet none of these can be used to identify a switch from a motion sensor? I don't think that's the way it was intended.

Ries
Posts: 33
Joined: Tuesday 01 December 2015 9:47
Target OS: Raspberry Pi
Domoticz version: 3.9639
Location: Netherlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by Ries » Monday 18 June 2018 14:59

dannybloe wrote:
Monday 18 June 2018 7:19
Yes, it is already on my list. Maybe for 2.5.
Nice! Thank you.
I already use the group approach, but the room approach seems more appropriate.

I also encoutered the type problem. Seems to be another feature request, I see naming conventions as a workaround too.
Last edited by Ries on Monday 18 June 2018 15:02, edited 1 time in total.
Version 3.9639
Platform: Jessie lite
Hardware: Raspberry pi 3B; RFXCOM; Weather Underground; Dummy; OpenZwave USB; Fritzbox Callmonitor via LAN interface; System Alive Checker (Ping); Philips Hue Bridge; Atag One Thermostat

snellejellep
Posts: 116
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi
Domoticz version: 3.97xx
Location: The Neterlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by snellejellep » Monday 18 June 2018 15:02

rrozema wrote:
Monday 18 June 2018 14:51
snellejellep wrote:
Monday 18 June 2018 14:45
you can use a prefix in the name of the devices like lampxxx or PIRxxx that is what i use and then with a wildcard like PIR* you can cycle trough them
Yes, that is a workaround. And i do things like that. However, dzvents exposes all sorts of attributes for each device and yet none of these can be used to identify a switch from a motion sensor? I don't think that's the way it was intended.
Image
cant you set the switch type to motion sensor like the image above?
raspberry pi | xiaomi gateway/vacuum | yeelight | philips hue | zwave |ubiquiti unifi | harmony

Ries
Posts: 33
Joined: Tuesday 01 December 2015 9:47
Target OS: Raspberry Pi
Domoticz version: 3.9639
Location: Netherlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by Ries » Monday 18 June 2018 15:05

cant you set the switch type to motion sensor like the image above?
It doenst show like that in the dzvents device object. It is a switch there.

Also the icon type doenst always reflect (in dzvents) the icon chosen.
Version 3.9639
Platform: Jessie lite
Hardware: Raspberry pi 3B; RFXCOM; Weather Underground; Dummy; OpenZwave USB; Fritzbox Callmonitor via LAN interface; System Alive Checker (Ping); Philips Hue Bridge; Atag One Thermostat

User avatar
waaren
Posts: 923
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by waaren » Monday 18 June 2018 15:19

In my environment a motion sensor is identified by dzVents as motion sensor. So I expect if it is not in your environment that it is something at another level than dzVents's

....
if trigger.switchType == "Motion Sensor"then
print("XMotion triggered: " .. trigger.name)
end

2018-06-18 15:16:40.710 Status: dzVents: XMotion triggered: XMotion-1
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

rrozema
Posts: 118
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: Delft
Contact:

Re: DzVents: Make rooms available as device groups

Post by rrozema » Monday 18 June 2018 18:01

I agree. It is probably not dzVents making these devices look all the same, that's why I said I am in need of some guidance here. To illustrate the problem, here's my device list filtered on devices that have 'motion' in their name:

As you can see my motion devices are all listed as 'Light/Switch' and SubType 'Switch'. I have yet to find how I can change these values. They automatically assigned when the device is first detected. In the properties in the Switches tab there is an option to select 'Switch Type:', which can be set to 'Motion Sensor', but that value can't be found in the properties dzVents exposes for the device:

Edit: Forum code can't make the attachments show up on the correct place. please see the attachments for the pictures.
Attachments
motion device switch properties.JPG
motion device switch properties.JPG (35.08 KiB) Viewed 668 times
motion devices.JPG
motion devices.JPG (77.35 KiB) Viewed 668 times

User avatar
waaren
Posts: 923
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by waaren » Monday 18 June 2018 19:18

rrozema wrote:
Monday 18 June 2018 18:01
I agree. It is probably not dzVents making these devices look all the same, that's why I said I am in need of some guidance here. To illustrate the problem, here's my device list filtered on devices that have 'motion' in their name:

As you can see my motion devices are all listed as 'Light/Switch' and SubType 'Switch'. I have yet to find how I can change these values. They automatically assigned when the device is first detected. In the properties in the Switches tab there is an option to select 'Switch Type:', which can be set to 'Motion Sensor', but that value can't be found in the properties dzVents exposes for the device:

Edit: Forum code can't make the attachments show up on the correct place. please see the attachments for the pictures.
Sorry but still don't get what your problem is with the identification of these sensors in dzVents. I see the same as you do in the devices tab but dzVents is able to identify the switchtype property correctly.
The output of this dzVents code snippet

Code: Select all

           dz.devices().forEach(function(device)
                if string.find(device.name,"otion")  or string.find(device.name,"eging")  then
                    print(" device ID: " .. device.idx .. " ===>>> " .. 
                            device.name .." ===>>> type: " .. 
                            tostring(device.switchType))
                end
            end)
            

Code: Select all

2018-06-18 19:15:11.955  Status: dzVents:  device ID: 30 ===>>> Trap bewegingsmelder ===>>> type: Motion Sensor
2018-06-18 19:15:11.956  Status: dzVents:  device ID: 32 ===>>> WC bewegingsmelder ===>>> type: Motion Sensor
2018-06-18 19:15:12.074  Status: dzVents:  device ID: 500 ===>>> Beweging buiten ===>>> type: Motion Sensor
2018-06-18 19:15:12.077  Status: dzVents:  device ID: 508 ===>>> Homewizard - Beweging buiten ===>>> type: Motion Sensor
2018-06-18 19:15:12.101  Status: dzVents:  device ID: 582 ===>>> XMotion-1 ===>>> type: Motion Sensor
2018-06-18 19:15:12.102  Status: dzVents:  device ID: 583 ===>>> XMotion-2 ===>>> type: Motion Sensor
2018-06-18 19:15:12.114  Status: dzVents:  device ID: 657 ===>>> XMotion-3 ===>>> type: Motion Sensor
2018-06-18 19:15:12.116  Status: dzVents:  device ID: 670 ===>>> Beweging kantoor ===>>> type: Motion Sensor
2018-06-18 19:15:12.146  Status: dzVents:  device ID: 794 ===>>> X-Motion zolderhok lux ===>>> type: On/Off  // combined Motion sensor / lux device
2018-06-18 19:15:12.147  Status: dzVents:  device ID: 795 ===>>> XMotion Zolderhok ===>>> type: Motion Sensor
2018-06-18 19:15:12.148  Status: dzVents:  device ID: 796 ===>>> X-Motion6 lux ===>>> type: On/Off     // combined Motion sensor / lux device
2018-06-18 19:15:12.149  Status: dzVents:  device ID: 797 ===>>> XMotion-6 ===>>> type: Motion Sensor

Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

rrozema
Posts: 118
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: Delft
Contact:

Re: DzVents: Make rooms available as device groups

Post by rrozema » Monday 18 June 2018 20:04

waaren wrote:
Monday 18 June 2018 19:18

Code: Select all

           dz.devices().forEach(function(device)
                if string.find(device.name,"otion")  or string.find(device.name,"eging")  then
                    print(" device ID: " .. device.idx .. " ===>>> " .. 
                            device.name .." ===>>> type: " .. 
                            tostring(device.switchType))
                end
            end)
            
Thank you. I don't know how I missed this. You are absolutely right, device.switchType will do the trick.

Ries
Posts: 33
Joined: Tuesday 01 December 2015 9:47
Target OS: Raspberry Pi
Domoticz version: 3.9639
Location: Netherlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by Ries » Monday 18 June 2018 20:12

How do you differentiate between lux devices that way? As well as computers or phone
Version 3.9639
Platform: Jessie lite
Hardware: Raspberry pi 3B; RFXCOM; Weather Underground; Dummy; OpenZwave USB; Fritzbox Callmonitor via LAN interface; System Alive Checker (Ping); Philips Hue Bridge; Atag One Thermostat

User avatar
waaren
Posts: 923
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents: Make rooms available as device groups

Post by waaren » Monday 18 June 2018 23:30

Ries wrote:
Monday 18 June 2018 20:12
How do you differentiate between lux devices that way? As well as computers or phone
Lux devices can be identified by their deviceType or deviceSubType. Please elaborate on the computers or phone. What kind of devices are they ? How are they defined ?
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests