User variable did not change by event

Moderator: leecollings

Post Reply
denman091
Posts: 30
Joined: Monday 31 July 2017 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Pijnacker
Contact:

User variable did not change by event

Post by denman091 »

He,

i have one virtual switch for my smartphone and one for my wifes smartphone. if one of us is at home (connect with the wifi) the virtual switch turns on.
Now i want a variable that goes to "1" if one of the two virtual switches is on. and when both virtual switches are off (so we are not at home) the variable need to change to "0".

I made a user variable with type: Float and name "Thuis".
i made the following event: Image
image uploader

Why is this not working?
User avatar
kuifje
Posts: 36
Joined: Wednesday 25 October 2017 16:38
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Heemskerk
Contact:

Re: User variable did not change by event

Post by kuifje »

Does it work on a specific time table, for instance When its 10 am. So no triggers from a phone but a clock.
When that does work you can go on from here.
Good luck.
Kuifje
denman091
Posts: 30
Joined: Monday 31 July 2017 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Pijnacker
Contact:

Re: User variable did not change by event

Post by denman091 »

kuifje wrote: Friday 08 December 2017 15:27 Does it work on a specific time table, for instance When its 10 am. So no triggers from a phone but a clock.
When that does work you can go on from here.
Good luck.
Kuifje
Now the event begins with IF: time > 00:00 and smartphone 1 or smarphone 2 = ON.

and now i receive the following error in the log:
2017-12-09 00:55:08.151 Error: EventSystem: Lua script error (Blockly), Name: Set Thuis variabel_2 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: ')' expected near 'comparevariable
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: User variable did not change by event

Post by StanHD »

I have similar events working with variables. I would use an Integer type Variablefor this.
May be worth a try?
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
denman091
Posts: 30
Joined: Monday 31 July 2017 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Pijnacker
Contact:

Re: User variable did not change by event

Post by denman091 »

StanHD wrote: Saturday 09 December 2017 6:34 I have similar events working with variables. I would use an Integer type Variablefor this.
May be worth a try?
I changed it to integer and make the event with 1 switch and that works.
This works:
Image

Then i change te event for 2 switches like:
Image
And this works not. What is wrong with this event? it looks like domoticz don't understand the "OR" in de event.
Or domoticz can not handle two switches in one part.

I put one of the switches "ON" but see not happens in the log.

Edit post:-------------------------------------------------------------------------------------------------------------------------------------------------
Ok, i found the problem.
The event has be like this:
Image
This is working.
denman091
Posts: 30
Joined: Monday 31 July 2017 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Pijnacker
Contact:

Re: User variable did not change by event

Post by denman091 »

problem solved.
See edit post
wuschels
Posts: 8
Joined: Saturday 30 December 2017 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: stable
Contact:

Re: User variable did not change by event

Post by wuschels »

It's much more easier to use "external input" in logical blocks.....
1x Pi1 (PiHole)
4x Pi3 ( Nextcloud, Domoticz, Kodi, MagicMirror)
1x AMD Quad-core, 32Gbyte RAM (SuSE-Linux, Vmware....)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest