Hi,
I’m new to openHAB and its scripting. I come from Domoticz and ‘Blockly’ rules.
My Domoticz system had the following rules;
“On smoke alarm Turn On all lights and sound siren”
“On motion turn on lights but only if Lux is below 8”
“Turn lights off if no motion or Lux above 12 - but only if no smoke alarm”
“Set Nest Termostat to ‘eco’ if either front or back door is open for longer then 10 seconds”
These are fairly simple scripts but I thought I’d start with the simplest (set nest to eco) but I am failing totally. As the door sensors have a nul state when the system starts I though I would test for the door state not equalling OPEN this seems to work but it doesn’t set the Nest Thermostat to eco.
This is the script - any advice?
rule "Thermostat to eco"
when
Item Security_Door_Front changed
then
if (Security_Door_Front.state != CLOSED)
{NestTStat_hvac_mode.sendCommand("eco")}
else
{NestTStat_hvac_mode.sendCommand("heating")}
end
This is what is being logged. The Thermostat never changes to eco
2018-07-31 15:35:19.815 [vent.ItemStateChangedEvent] - Security_Door_Front changed from NULL to OPEN
2018-07-31 15:35:20.187 [ome.event.ItemCommandEvent] - Item 'NestTStat_hvac_mode' received command heating
2018-07-31 15:35:20.192 [vent.ItemStateChangedEvent] - NestTStat_hvac_mode changed from NULL to heating
2018-07-31 15:35:22.834 [me.event.ThingUpdatedEvent] - Thing 'zwave:device:657f1a0f:node7' has been updated.
2018-07-31 15:35:22.996 [vent.ItemStateChangedEvent] - Security_Door_Front changed from OPEN to CLOSED
2018-07-31 15:35:23.012 [ome.event.ItemCommandEvent] - Item 'NestTStat_hvac_mode' received command eco
2018-07-31 15:35:23.018 [vent.ItemStateChangedEvent] - NestTStat_hvac_mode changed from heating to eco
`2018-07-31 16:22:56.619 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.nest.handler.NestThermostatHandler@b347c': No enum constant org.openhab.binding.nest.internal.data.Thermostat.Mode.heating`
It stopped working for me but maybe I was playing around with the nest permissions and api with a python script. The 2.0 binding works fine too. More stable I find.