Hi all, I setup some dash buttons in the greenhouse. Pretty simple use case. We water plants everyday, some days with nutrients, some days we do the floors. Wanted a way that worker bees could just press a button when they water etc. Dash button fit the bill.
I installed them just fine. Push the button and rule fires. Problem is, the dash button just keeps on triggering and adding to the count. I posted the rule below:
//daily tasks
var Number Floor_Spray
rule "Floor Spray Counter"
when
Item Floor_Trigger received command ON
then
Floor_Spray = Floor_Spray + 1
logInfo("floor water counter", Floor_Spray.toString)
Floor_Spray1.postUpdate(Floor_Spray)
end
rule "Dash Floor Spray Counter"
when
Channel "amazondashbutton:dashbutton:78-e1-03-98-69-00:press" triggered
then
Floor_Spray = Floor_Spray + 1
logInfo("floor water counter", Floor_Spray.toString)
Floor_Spray1.postUpdate(Floor_Spray)
end
//Dash Timestamp for sparying the floor
rule "Dash Timestamp for spraying the floor"
when
Channel "amazondashbutton:dashbutton:78-e1-03-98-69-00:press" triggered // floor sprayed
then
floorsprayed_timestamp.postUpdate(new DateTimeType()) //defaults to now
end
//Timestamp for sparying the floor
rule "Timestamp for spraying the floor"
when
Item Floor_Trigger received command ON // floor sprayed
then
floorsprayed_timestamp.postUpdate(new DateTimeType()) //defaults to now
end
//rule to reset the Switch
rule "Reset floor switch"
when
Time cron "1 * * * * ?"
then
if(Floor_Trigger.state==ON ) {
Floor_Trigger.sendCommand(OFF)
}
end
rule "Today Floor Spray Reset"
when
Time cron " 0 0 1 1/1 * ? *"
then
Floor_Spray = 0
Floor_Spray1.postUpdate(0)
Then my log just starts doing this… without any button press:
2019-04-06 12:53:47.688 [vent.ChannelTriggeredEvent] - amazondashbutton:dashbutton:78-e1-03-98-69-00:press triggered
==> /var/log/openhab2/openhab.log <==
2019-04-06 12:53:47.721 [INFO ] [ome.model.script.floor water counter] - 4
==> /var/log/openhab2/events.log <==
2019-04-06 12:53:47.748 [vent.ItemStateChangedEvent] - floorsprayed_timestamp changed from 2019-04-06T12:53:41.708-0400 to 2019-04-06T12:53:47.723-0400
2019-04-06 12:53:47.755 [vent.ItemStateChangedEvent] - Floor_Spray1 changed from 3 to 4
thoughts on this one?