I have an Aeon ZW062 Garage Door controller that I have mostly working, in that I can activate the switch and the door opens and closes, and I can see the door status in paperui.
However, I’m wanting to be able to send a specific ‘Open’ or ‘Close’ command, which doesn’t seem possible?
I can send an ‘ON’ command to the Switch - but if the door is already open, this will close the door.
If the door is already open, and I send an ‘Open’ command, I’d like the door to stay open - Openhab knows the status of the door.
Any tips on how to achieve this? I’m thinking I need some kind of rule that says if an Open command is received, to check the status of the door before ignoring the command or activating the switch, that can be made accessible via the rest API?
2018-04-08 19:07:36.394 [vent.ItemStateChangedEvent] - Garage_Door changed from OFF to ON
2018-04-08 19:07:36.540 [vent.ItemStateChangedEvent] - Garage_status changed from NULL to 254
2018-04-08 19:07:58.958 [vent.ItemStateChangedEvent] - Garage_status changed from 254 to 255
2018-04-08 19:08:17.061 [vent.ItemStateChangedEvent] - Garage_Door changed from ON to OFF
2018-04-08 19:08:17.218 [vent.ItemStateChangedEvent] - Garage_status changed from 255 to 0
2018-04-08 19:08:26.842 [ome.event.ItemCommandEvent] - Item 'Garage_Door' received command ON
2018-04-08 19:08:26.854 [vent.ItemStateChangedEvent] - Garage_Door changed from OFF to ON
2018-04-08 19:08:27.162 [vent.ItemStateChangedEvent] - Garage_Door changed from ON to OFF
2018-04-08 19:08:27.673 [vent.ItemStateChangedEvent] - Garage_Door changed from OFF to ON
2018-04-08 19:08:27.815 [vent.ItemStateChangedEvent] - Garage_status changed from 0 to 254
2018-04-08 19:08:49.891 [vent.ItemStateChangedEvent] - Garage_status changed from 254 to 255
2018-04-08 19:09:00.672 [ome.event.ItemCommandEvent] - Item 'Garage_Door' received command OFF
2018-04-08 19:09:00.682 [vent.ItemStateChangedEvent] - Garage_Door changed from ON to OFF
2018-04-08 19:09:00.912 [vent.ItemStateChangedEvent] - Garage_Door changed from OFF to ON
2018-04-08 19:09:01.693 [vent.ItemStateChangedEvent] - Garage_status changed from 255 to 252
Both. 1st 3 lines are button press on the wall remote and the door status changing to door open; next 2 lines are the button press to close the door.
2018-04-08 19:08:26.842 is the sitemap button press top open the door; followed by 2018-04-08 19:09:00.672 which is the sitemap button press to close the door.
rule "Garage Door"
when
proxyGarageDoor received command
then
if (receivedCommand.toString != Garage_door.state.toString) {
Garage_door.sendCommand(receivedCommand.toString)
}
end
rule "Garage door state"
when
Garage_door received update
then
proxyGarageDoor.postUpdate(Garage_door.state.toString)
end
OK, I got distracted… the rules posted above didn’t quite work, I got errors like:
2018-04-08 19:29:02.476 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'ProxyGarage.rules' has errors, therefore ignoring it: [3,5]: no viable alternative at input 'proxyGarageDoor'
[12,5]: no viable alternative at input 'Garage_door'
To get around this, I needed to use the following for rules:
rule "Garage Door"
when
Item proxyGarageDoor received command
then
if (receivedCommand.toString != Garage_Door.state.toString) {
Garage_Door.sendCommand(receivedCommand.toString)
}
end
rule "Garage door state"
when
Item Garage_Door received update
then
proxyGarageDoor.postUpdate(Garage_Door.state.toString)
end
I still need to do some debugging - my sitemap presents with a ‘Closed’ and ‘Open’ button - clicking ‘Closed’ with the door closed resulted in the door opening, so something isn’t quite right - a job for the weekend methinks to do some more debugging.