Well you could use a dummypresence sensor to show the state of your buttons.
{
"id": "kraanstatus",
"class": "DummyPresenceSensor",
"name": "Kraan Status",
"autoReset": false
},
and for auto mode
{
"id": "kraanauto",
"class": "DummyPresenceSensor",
"name": "Kraan Auto Modus",
"autoReset": false
},
here’s the rule for it :
IF button-on is pressed THEN switch on kraan voor and set presence of kraanstatus present and set presence of kraanauto absent
IF button-off is pressed THEN switch off kraan voor set presence of kraanstatus absent and set presence of kraanauto absent
If button-auto is pressed THEN set presence of kraanauto present and set presence of kraanstatus absent
now you will have to define the auto modus with some rules
IF kraanauto is present and temperature < 5 THEN switch off kraan voor
IF kraanauto is present and temperature > 9 THEN switch on kraan voor
another possitility would be a state variable as previously said by @SLiX
for that you will have to create a variable called $kraanmodus and a variables device like that :
{
"id": "kraanstatus",
"class": "VariablesDevice",
"name": "Kraan Status",
"variables": [
{
"name": "value",
"type": "string",
"expression": "$kraanmodus",
"unit": ""
}
]
},
now your rules look like that
IF button-on is pressed THEN switch on kraan voor and set $kraanmodus = "On"
(or Aan for NL i guess)
IF button-off is pressed THEN switch off kraan voor set $kraanmodus = "Off"
(or Uit for NL i guess)
If button-auto is pressed THEN set $kraanmodus = "Auto"
IF $kraanmodus = "Auto" and temperature < 5 THEN switch off kraan voor
IF $kraanmodus = "Auto" and temperature > 9 THEN switch on kraan voor
I personally would preferr the second method. but its a matter of taste i guess.
hope all of this is thought through …
what do you think guys?