• 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
What exactly is the difference between
IF ... THEN switch DEVICE lamp TO off
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.
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
See here in Post #2: http://forum.pilight.org/Thread-Switch-without-a-state
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

Possibly Related Threads...
Thread Author Replies Views Last Post
  [Solved] On and Off for one device in one rule Oliver 3 952 10-28-2019, 06:55 PM
Last Post: Oliver
  Sunset state check parse error dennisvo 6 1,147 09-27-2019, 08:34 PM
Last Post: curlymo
  Can't switch Relay device by rules: Error switch.lua:77 wobbi 6 1,932 07-31-2018, 06:25 AM
Last Post: curlymo
  Rule with&without device. One working not the other... Tamadite 9 2,419 07-24-2018, 08:55 AM
Last Post: curlymo
  Program can't be set to state running Gisto 7 2,104 07-17-2018, 12:51 PM
Last Post: Gisto
  feature request: switching rules terrar 7 2,281 05-05-2018, 09:23 PM
Last Post: trader23
  Always trigger event on any device state Phil 8 3,506 03-22-2017, 07:30 PM
Last Post: Phil
  [Solved ]Turn off device at random time manmetdehamer 4 2,796 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 2,395 04-02-2016, 10:24 PM
Last Post: koos147
  Triggering device at specific time or sunrise if sunrise is after OrTiN 3 2,171 03-24-2016, 11:11 PM
Last Post: OrTiN

Forum Jump:

Browsing: 1 Guest(s)