Outputs Resetting - Buttons

Hi

I am assembling a very simple project to monitor a battery voltage and switch on a pump in my boat using Bolt. I have managed to get the control of the relays to work, but every time the Bolt sends an update to the cloud (every 5 mins) my outputs reset and the relays change back to off.

Does anyone have a suggestion of how to fix this?

Code below

singleButton({name:“Bilge On”, action:“digitalWrite”,
pin:“2”, value:“HIGH”,bgcolor:“green”,
shape:“rectangle”,align:“left”,“text_color”:“white” })

singleButton({name:“Bilge Off”, action:“digitalWrite”,
pin:“2”, value:“LOW”, bgcolor:“red”,
shape:“rectangle”, align:“left”, text_color:“black”})

singleButton({name:“House Battery”, action:“digitalWrite”,
pin:“3”, value:“HIGH”,bgcolor:“green”,
shape:“rectangle”,align:“left”,“text_color”:“white” })

singleButton({name:“Start Battery”, action:“digitalWrite”,
pin:“3”, value:“LOW”, bgcolor:“red”,
shape:“rectangle”, align:“left”, text_color:“black”})

singleButton({name:“Lights On”, action:“digitalWrite”,
pin:“4”, value:“HIGH”,bgcolor:“green”,
shape:“rectangle”,align:“left”,“text_color”:“white” })

singleButton({name:“Lights Off”, action:“digitalWrite”,
pin:“4”, value:“LOW”, bgcolor:“red”,
shape:“rectangle”, align:“left”, text_color:“black”})

@mmullins
This generally happens when you have created a product and linked to the device which is in Input Mode.

So as per the configuration of your product [ data collection every 5 minutes], the data gets fetched and hence the pins reset.

To avoid this, you will have to unlink the product from the device and close any device view page if open.