blocky presence for many people Topic is solved

Moderator: leecollings

Post Reply
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

blocky presence for many people

Post by markjgabb »

hi guys

im trying to do a someone is home blocky which i know is pretty common and has been done alot, but i havent seen on for more than 2 people

so we have 4 people in our house
with a switch for each person
p1
p2
p3
p4

so ive created another dummy called occupied

so i would like a if p1 or p2 or p3 or p4 is home set occupied to on, but i cant seem to get the or's right, it seems to me that you can do that many ors in one sentance or it would be a matter of nested ors and im not sure if that would work
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
jannl
Posts: 825
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.5.x
Location: Geleen
Contact:

Re: blocky presence for many people

Post by jannl »

Not sure if this is common. Most people do presence detection with a python or perl script as found in the wiki.
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

Re: blocky presence for many people

Post by markjgabb »

Yeah I've got the presence detection part working. It's just the last bit.
The if anyone of these switches are on turn this switch on.
I figured that might be easier in blocky

Sent from my SM-G900F using Tapatalk
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: blocky presence for many people

Post by pvm »

Can you show your current blockly? It shouldn't be a problem. Users (like me) who use geofencing with a virtual switch for every user need this functionality.

You can add an 'or' block to the if and in one of the two 'or' sides put another 'or'. And in the 'else' part use the same construction with 'and' blocks to turn the switch off
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
User avatar
Siewert308SW
Posts: 294
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: blocky presence for many people

Post by Siewert308SW »

indeed pvm

Something like this should work.

if P1 == on and occupied == off then
occupied = on
end

---

if P2 == on and occupied == off then
occupied = on
end

---

if P3 == on and occupied == off then
occupied = on
end

---

if P4 == on and occupied == off then
occupied = on
end

---

if P5 == on and occupied == off then
occupied = on
end

---

if p1 = off and p2 == off and p3 == off and p4 == off and p5 == off and occupied == on then
occupied = off
end
Setup:
- DS923+ Docker
Domoticz Latest Stable
Mosquitto / ZwaveJSUI @ Aeotec Z-Stick Gen5+ / PiHole Unbound
P1 USB Gas/Power, HW watermeter
- A lot of Zwave switches, contacts, plugs, smoke/Co2 ect
- DiY 7.5kWh Solar Storage @ GitHuB
mayyam
Posts: 47
Joined: Saturday 14 January 2017 11:29
Target OS: Linux
Domoticz version: 4.11333
Location: Poland
Contact:

Re: blocky presence for many people

Post by mayyam »

Maybe this one can help You. It's working for me.
viewtopic.php?f=23&t=31&start=100#p27521

I'm checking 4 phones that way (well, 2 phones, but 4 MACs because of AP).
I've 3 blocky:
1 - to check if two MACs of first person are present - presence of first person = on or off
2 - to check if two MACs of second person are present - presence of second person = on or off
3 - to check if two persons are present = presence of two people = on or off
_______________
- Dell FX-160 / Ubuntu 16.04
- RFLink 433Mhz / NRF 2.4GHz
- 2x Xiaomi Gateway
- different species of ESP8266
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

Re: blocky presence for many people

Post by markjgabb »

sorry for slow reply

this is the current blocky I use below
the occupancy switch just never changes to on
occupancy blocky.PNG
occupancy blocky.PNG (13.14 KiB) Viewed 2086 times
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

blocky presence for many people

Post by pvm »

In the else part you use 'on' guess that should be 'off'
I would add an extra check to make sure when presence is on it does not switch on again
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

Re: blocky presence for many people

Post by markjgabb »

wow, i cant believe i missed that......seriously.....how the heck did i miss it had on set there.....works perfectly now, so the aditional check so chuck the entire set of or and one side and put an and box around it?

wow thanks...ive been staring at that for hours and never saw that
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: blocky presence for many people

Post by pvm »

If off and (p1 on or p2 on) etc
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

Re: blocky presence for many people

Post by markjgabb »

excelent...seem to be working now

thanks guys...still slapping myself for missing that one
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest