iLONDA fish feeder Openhab

Here I share my project with iLONDA fish feeder and Openhab,
I realized it has Esp8266 2MB inside,so I made a simple diagram, I find out the pinout. I reflashed with espeasy and then I wrote some rule in order to control it by MQTT, after that I made the item, sitemap and the rule in Openhab and it worked.

*Rule espeasy

on push#State do
gpio,5,0      // ligth blue on
gpio,14,1     // motor start
timerSet,1,1    
endon

On Rules#Timer=1 do  //When Timer1 expires 1 segundo, do
gpio,5,1    //ligth blue off
gpio,14,0
endon

Openhab Rule**

rule "Fish Feeder"
when Item Fish changed from OFF to ON
then 
logInfo("Fish", "Start")
timer = createTimer(now.plusSeconds(2)) [|
if (Fish.state == ON && Fish_sensor.state == OPEN)
{  publish("broker","Fish_Feeder/gpio/14","1")
   publish("broker","Fish_Feeder/gpio/5","0")
   playSound("doorbell.mp3")
   timer = createTimer(now.plusSeconds(3)) [|
   publish("broker","Fish_Feeder/gpio/14","0")
   publish("broker","Fish_Feeder/gpio/5","1")
   sendCommand(Fish,OFF) ]
 }]
end

rule "Fish timestamp"
when Item Fish_sensor changed from OPEN to CLOSED
then
Fish_On_Time.postUpdate(new DateTimeType())
end

Openhab Item***
Switch Fish “Fish Feeder” {mqtt= “<[broker:Fish_Feeder/push/State:state:MAP(my3.map)]” }
Contact Fish_sensor “Status [MAP(my4.map):%s]” {mqtt= “<[broker:Fish_Feeder/sensor/State:state:MAP(my4.map)]” }
DateTime Fish_On_Time “Last feeding [%1$ta %1$tR]”

Sitemap***

Frame label="Fish Feeder" 
	{ Text item=Fish icon="fish.png"  {
		Frame
			{ Switch item=Fish
	 		 Text item=Fish_sensor   
			 Text item=Fish_On_Time
		
			}
    }	}


Fish_feeder_diagram

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.