• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difference switching device or state
#1
What exactly is the difference between
Code:
IF ... THEN switch DEVICE lamp TO off
and
Code:
IF ... THEN switch DEVICE lamp.state TO off
?

I've seen both in examples. So what does `lamp.state` do in comparison to `lamp`? I assume that switching the state is only switching the GUI element's visual state but not the real state of the device... so this would reset the GUI switch to off but not switch off the lamp itself. If yes, what is it used for?

Thanks in advance.
 
Reply
#2
The second one is a wrong entry and should not work.
Could you please post the thread where you found this so it can be corrected?
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
#3
See here in Post #2: http://forum.pilight.org/Thread-Switch-without-a-state
 
Reply
#4
Thanks for reporting.
I corrected the post and also deleted your code snippet (beause contained also the wrong code) Wink
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Solved] On and Off for one device in one rule Oliver 3 436 10-28-2019, 06:55 PM
Last Post: Oliver
  Sunset state check parse error dennisvo 6 457 09-27-2019, 08:34 PM
Last Post: curlymo
  Can't switch Relay device by rules: Error switch.lua:77 wobbi 6 1,070 07-31-2018, 06:25 AM
Last Post: curlymo
  Rule with&without device. One working not the other... Tamadite 9 1,376 07-24-2018, 08:55 AM
Last Post: curlymo
  Program can't be set to state running Gisto 7 1,279 07-17-2018, 12:51 PM
Last Post: Gisto
  feature request: switching rules terrar 7 1,444 05-05-2018, 09:23 PM
Last Post: trader23
  Always trigger event on any device state Phil 8 2,404 03-22-2017, 07:30 PM
Last Post: Phil
  [Solved ]Turn off device at random time manmetdehamer 4 2,198 07-27-2016, 03:35 PM
Last Post: manmetdehamer
  ERROR: rule #21 invalid: variable "label" of device "WindMax" cannot be used in even koos147 2 1,912 04-02-2016, 10:24 PM
Last Post: koos147
  Triggering device at specific time or sunrise if sunrise is after OrTiN 3 1,690 03-24-2016, 11:11 PM
Last Post: OrTiN

Forum Jump:


Browsing: 1 Guest(s)