dazeddnc
Posts: 10
Joined: Sun Feb 02, 2014 10:19 pm

Hydroponics web interface

Thu Apr 25, 2019 1:16 am

Years ago, I started building a website that I was going to run on my Pi. I've finished exactly one page.

I stumble on trying to learn MQTT, etc and before long, I'm burnt out and moved on to other things.

But... I still really want to automate my watering and lights :(
I'd like to have manual control and monitoring via a website.

I had this theory about dividing my system across multiple NodeMCu's.
I don't have plants in a nice little stand. They're scattered here and there. Some indoors. Some outdoors. Some are moved seasonally.
So a highly modular design seems like the way to go.

One node might be in a back corner at a rain bucket operating the watering pump.
Another might track moisture, operate a valve, and control lighting for "zone 1"
Another might track moisture, operate a valve, and control lighting for "zone 2"
Another might be across the room running a fan to pump in fresh air.
They would talk to the pi. The pi would issue control instructions to one or more NodeMCU's according to relationships defined between "zones" and auxiliary components like fans and pumps.
I would like to avoid dependency on "cloud" services. They are awesome for ease of deployment. But....when the service vaporizes...so does anything that depends on them. If the service updates or goes offline, it may take down some or all of my system's control and monitoring capacity. I'd prefer to just host all required services on a home server that is completely under my control.

I've been hoping to find a ready-made project that follows this sort of mechanic.
There are only a few hundred around. One of them must have things fairly well figured out.
But, they're mostly just github repositories. Finding previews and trying to decide what would be a good fit is proving irksome.
A lot of them seem to be cloud based or not actively developed. Maybe half-baked and dead ended like my own attempt.

Is anyone currently running a system that parallels what I'm after?

User avatar
omegaman477
Posts: 148
Joined: Tue Feb 28, 2017 1:13 pm
Location: Sydney, Australia

Re: Hydroponics web interface

Thu Apr 25, 2019 11:56 am

Working on a similar project except for a high rise apartment and solar powered.

There are several Irrigation projects for Linux and RPI, notably OpenSprinkler Pi (OSPi) — https://rayshobby.net/wordpress/ospi/

They look very fancy, but there is some work to port the code to other (your DIY) hardware. I dont think they support multi nodes.

I decided to take a bespoke approach, using off the shelf hats and I/O where possible. Stage one was to get the basic I/O sorted, plumbing, pump, solar charging, battery management, soil sensors, etc all working, as standalone Python code parcels. I achieved basic daily watering with just 10 lines and a CRON job.

Stage 2 was then to plan the automation framework, so much easier when you know the H/W is working. Web interface was a nice to have, IFTTT control was more important as I wanted a hands off system, controlled by my main HA system (HomeSeer). Real issues always need shell/SSH.

I still believe that I would have spent longer hacking a 3rd party project like OpenSprinkler to my hardware. Especially when I didn't need 90% of its features.
..the only thing worse than a stupid question is a question not asked.

dazeddnc
Posts: 10
Joined: Sun Feb 02, 2014 10:19 pm

Re: Hydroponics web interface

Sat Apr 27, 2019 4:26 pm

Thanks for taking some time to share thoughts.

His idea with the expansion boards gets close to what I'd like to do. But, it sounds like he's using hardware to select which board he's talking with. I don't want 5-20 ft of data cables patching each zone to another. Just wouldn't be practical. To transition to a wireless network, I'm picturing a lot of modification would be needed. As you say, probably less painful to start from scratch. :(

PhatFil
Posts: 1424
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Hydroponics web interface

Sat Apr 27, 2019 7:25 pm

Perhaps Mqtt is worth another superficial look hosting a simple broker without any security should be fine as long as its garden metrics and not bank account details your using it with..

Node-red and mqtt are the backbone of my own conservatory watering system which at its most complex used cheap ble wireless moisture sensors to trigger watering via pumps when moisture levels dropped below a threashold value.
(currently its a simple timer based system- it changes..) the node red dashboard provides a gui interface where you can set values and graph readings and access from any web browser.

valves/pumps etc can then be controlled by basic soc wifi enabled systems again via mqtt, for which i can thoroughly recommend the tasmota firmware.
edit to add link https://github.com/arendst/Sonoff-Tasmota/wiki

dazeddnc
Posts: 10
Joined: Sun Feb 02, 2014 10:19 pm

Re: Hydroponics web interface

Sun Apr 28, 2019 2:17 am

I've been dreaming of this ever since learning how to control a parallel port's output pins.
My original idea was to stuff a junk laptop in an enclosure with some relay boards.
Things just keep evolving before I get anything programmed and assembled :lol:

Next was arduino. I probably would have landed at something like OpenSprinkler Pi if I had been more dedicated.

I started to get an inkling that I needed MQTT once I realized wiring a bunch of remote-located sensors and valves to one arduino wasn't going to make sense. I needed a collection of "simpler" boards that managed little pieces of it rather than having one central brain...but they need to be able to talk to each other then.

My head kind of exploded when I was trying to understand how to use it though. I'm not sure why. I guess... maybe overthinking it.
I spent most of today taking a second look. I managed to get a broker running on my pi. It's also running NodeRed, although... I don't have a solid idea how that does/does not help.

PhatFil,
It so happens I looked at one of the SonOff switches for a potential application at work. The provided scheduling app seems kinda....broken? At home, I can connect fine. At work, I can't get it on the network. It won't work when connecting directly to my phone because it's lacking internet access. I wondered about possible DIY firmware to use a less broken interface. Evidently someone's already worked that out? Neat.

I might have decent luck adapting Tasmota to run more than a single output and plop that on a NodeMCU. SonWeb looks to have some nice features too. Very cool.

PhatFil
Posts: 1424
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Hydroponics web interface

Mon Apr 29, 2019 11:47 pm

Node Red can take a bit of getting the hang of. but once you 'get' the whole data flow thing it becomes a very powerful tool. letting you accomplish a lot with only a handful of nodes..

if it helps i could share my watering system flows, including a gui with graphs and moisture level trigger setting.
i use the Xiaomi miflora BLE plant sensors which provide metrics for light level, temperature, soil moisture level, and soil EC levels, along with a battery level. the node red system waters (sends 'On' commands to pumps controlled by tasmota switches) based on a trigger level set in the gui (dashboard) metrics are displayed in graphs, if High or Low readings are taken a warning email is sent to raise awareness..

Image

the gui(dashboard) aspect is a bit more complex


Image

OK the layout of the dashboard could do with a bit more input, but as its only me looking at it ..

Image

If the flow text to import into your node-red system would be useful just say so and i will edit out all the security and email details and post..

links to alternative Xiaomi sensor exploits
https://github.com/ThomDietrich/miflora-mqtt-daemon
https://zsiti.eu/xiaomi-mijia-hygrother ... pberry-pi/

dazeddnc
Posts: 10
Joined: Sun Feb 02, 2014 10:19 pm

Re: Hydroponics web interface

Thu May 09, 2019 12:33 am

I've forked my efforts in a couple of directions. The fact that everything is built around the ESP8266 is kinda helping me stick to a core building block for everything I'm trying to do.

I've been trying to build SMTP functions into tasmota. Near as I can tell, it's not already in there.
Trying to make it as self-contained as possible. I don't want dependence on cloud services where avoidable.

I'm running into some kind of snafu upon connecting a client to gmail though. I'm getting stack errors. I *think* it's running out of memory. I spent most of today hunting down fluff that can be removed. I removed all I2C sensors, extra modules, CO2 sensors, etc. It's still throwing stack errors...so maybe I'm guessing wrong. Anyway...drifting away from raspberry pi territory there.

On the home front, I did work out how to hook my aquarium to a nodeMCU running stock tasmota. At present, it just runs the light and a water cycling pump. It's just based on a schedule. I have it set up to fill until a float switch blocks off flow. At which point, water pressure trips a switch and electrically shuts off the auto-top-off pump. After a couple of minutes, the schedule is set to stop running the pump as well. So, if the float fails...my room will only be semi-flooded :lol:

I have some differential pressure switches which could be used to measure the water level. If I find that flooding is actually a real issue...I could add some feedback regarding tank level instead. Just seemed simpler to side-step adding a sensor.

Soo....now its a matter of figuring out how I want to approach establishing pin configurations and zone-to-pump relationships. Looks like node-red makes life simpler. But, if I wanted to re-create this project in a form factor that I could give to someone else....I don't know. It feels a little too much like duct taping stuff together. Raises the learning curve. I'm not 100% sold on node red yet.

PhatFil
Posts: 1424
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Hydroponics web interface

Thu May 09, 2019 3:10 pm

Yikes adding email to tasmota with its already quite large footprint is a biggy!!

GIve node red a try .. Sending an email is pretty trivial.. Install/start it on your pi and copy the following text into your clipboard and import it into node red on your pi. while my sensor readings are taken from a different source to you, you can see how i handle all the metrics testing if within expected range and how i raise a 'Notification' which results in an email getting sent when unexpected readings are encountered.

Basically my flows are as short as possible - input either injection or via mqtt subscriptions is followed by a test and the result if useful is republished as mqtt for further handling by another 'short' flow.

so if a plant needs watering (moisture less than a certain level) I issue a water plant x mqtt 'notification'
This in turn is picked up by a subscription to watering notifications and the relevant pump is triggered.



I do use the contrib-xiaomi-ble-node and the persistent storage nodes which you will need to install via the node red pallete manager, there may be another 1 or 2 nodes needing installing too you should receive warnings on import or deploy accordingly..


Code: Select all

[{"id":"c3d8d21d.ac538","type":"tab","label":"PlantCare","disabled":false,"info":""},{"id":"26d39530.b717ea","type":"inject","z":"c3d8d21d.ac538","name":"Plant1 inj","topic":"Plant1","payload":"c4:7c:8d:64:43:f5","payloadType":"str","repeat":"3600","crontab":"","once":true,"onceDelay":"","x":101,"y":111.00002002716064,"wires":[["1d99d60c.b4c55a"]]},{"id":"51cf8268.4697dc","type":"inject","z":"c3d8d21d.ac538","name":"Plant2 inj","topic":"Plant2","payload":"c4:7c:8d:64:43:c8","payloadType":"str","repeat":"3600","crontab":"","once":true,"onceDelay":"300","x":101,"y":161.00001335144043,"wires":[["1d99d60c.b4c55a"]]},{"id":"78b1deb3.88835","type":"inject","z":"c3d8d21d.ac538","name":"Plant3 inj","topic":"Plant3","payload":"c4:7c:8d:64:43:6f","payloadType":"str","repeat":"3600","crontab":"","once":true,"onceDelay":"600","x":100,"y":206.00001430511475,"wires":[["1d99d60c.b4c55a"]]},{"id":"1c41c424.ff905c","type":"inject","z":"c3d8d21d.ac538","name":"Plant4 inj","topic":"Plant4","payload":"c4:7c:8d:64:47:a7","payloadType":"str","repeat":"3600","crontab":"","once":true,"onceDelay":"900","x":104,"y":252.00001335144043,"wires":[["1d99d60c.b4c55a"]]},{"id":"36fbacc.ae78154","type":"inject","z":"c3d8d21d.ac538","name":"Plant5 inj","topic":"Plant5","payload":"c4:7c:8d:64:43:ae","payloadType":"str","repeat":"3600","crontab":"","once":true,"onceDelay":"1200","x":103,"y":295.00001430511475,"wires":[["1d99d60c.b4c55a"]]},{"id":"371ccf6a.50371","type":"inject","z":"c3d8d21d.ac538","name":"Plant6 inj","topic":"Plant6","payload":"c4:7c:8d:64:43:61","payloadType":"str","repeat":"3600","crontab":"","once":true,"onceDelay":"1500","x":104,"y":335.00001430511475,"wires":[["1d99d60c.b4c55a"]]},{"id":"9b4c06d9.1a8158","type":"function","z":"c3d8d21d.ac538","name":"Notification machine","func":"Requires:\n// A sensor id saved in the flow variable 'plant'\n// And a message with a payload containing Json tupples\n// of metric:reading\n// Returns\n// a set (array) of 4 messages with the topic drived from\n// both the plant/sensor id and the metric the data represents\n// in the format Notify/Plant/X(plantid)/metric\n//Results\n// no expected side effects\nvar plant = flow.get('plant')||'PlantY';\nif (plant == 'PlantY'){\n    return null ;\n}\nvar part1 = plant.slice(0,5);\nvar part2 = plant.slice(-1);\nplant = part1 +'/' + part2;\nvar msg1 = { payload: msg.payload.moisture };\nvar msg2 = { payload: msg.payload.battery };\nvar msg3 = { payload: msg.payload.temperature };\nvar msg4 = { payload: msg.payload.conductivity };\n//moisture msg1\n//msg1.payload =  msg.payload.moisture;\nmsg1.topic = 'Notify/'+ plant +'/M';\n// battery msg2\n//msg2.payload = msg.payload.battery;\nmsg2.topic = 'Notify/'+ plant +'/B';\n// Temp msg3\n//msg3.payload = msg.payload.temperature; //.payload.temperature;\nmsg3.topic = 'Notify/'+ plant +'/T';\n//EC msg4\n//msg4.payload = msg.payload.conductivity;\nmsg4.topic = 'Notify/'+ plant +'/EC';\nreturn [[msg1,msg2,msg3,msg4]]","outputs":1,"noerr":0,"x":781.0000457763672,"y":245.99999904632568,"wires":[["ddb0a395.139ff"]]},{"id":"ddb0a395.139ff","type":"mqtt out","z":"c3d8d21d.ac538","name":"Notify!","topic":"","qos":"","retain":"","broker":"ae8b7594.28f7f8","x":997.9999809265137,"y":245.99999904632568,"wires":[]},{"id":"99035255.d2e98","type":"mqtt in","z":"c3d8d21d.ac538","name":"","topic":"Notify/Plant/#","qos":"2","broker":"ae8b7594.28f7f8","x":372.0000915527344,"y":295.0001277923584,"wires":[["66f8a869.744948"]]},{"id":"66f8a869.744948","type":"function","z":"c3d8d21d.ac538","name":"Warnings Generator","func":"//WORK IN PROGRESS\n// only looking at sensors atm, other notifications to be catered for later\n// Battery, temperature, and EC warning levels are\n// hard coded until moisture gui is sorted..  \n//Requires;\n// a notification message, its topic prefixed with 'Notify/'\n// Sensor data:\n//  sensor data topics will follow 'Notify/' with 'Plant/'\n// the next 2 topic keys are the sensor/plant area number and the metric code\n// the payload is the data referenced by the topic\n//Returns:\n// any message recieved failing any conditions tested a suitable\n// warning/error/action message will be issued.\n//Results:\n// no unexpected side effects\nvar plantid = msg.topic.split(\"/\")[2];\nvar metric = msg.topic.split(\"/\")[3];\nswitch(metric) {\n    case 'M': // moisture\n    var pxmml = 'P' + plantid + 'MML';\n    var mml = global.get(pxmml)||30;\n    if (msg.payload < mml) {\n        msg.topic = 'Action/Water';\n        msg.payload = plantid; \n        return msg;\n        }\n        break;\n    case 'B': //Battery level\n    if(msg.payload < 15){\n        msg.topic = 'Warning/Plants/' + plantid + '/Low battery level';\n        return msg;\n        }\n        break;\n    case 'T': // Temperature\n    if(msg.payload < 10){\n        msg.topic = 'Warning/Plants/' + plantid + '/Low Temperature';\n        return msg;\n        }\n    if(msg.payload > 35) {\n        msg.topic = 'Warning/Plants/' + plantid + '/High Temperature';\n        return msg;\n    }\n    break;\n    case 'EC': // EC\n    if(msg.payload < 150) {\n        msg.topic = 'Warning/Plants/' + plantid + '/Low EC Level';\n        return msg;\n        }\n    break;\n    default:\n    msg,topic = 'Happy/Happy';\n    msg.payload ='Joy/Joy';\n    return msg;\n}\n","outputs":1,"noerr":0,"x":778.0001602172852,"y":297.0000591278076,"wires":[["17895591.6150ca"]]},{"id":"17895591.6150ca","type":"mqtt out","z":"c3d8d21d.ac538","name":"Issue warnings etc","topic":"","qos":"","retain":"","broker":"ae8b7594.28f7f8","x":1037.0000801086426,"y":296.0000591278076,"wires":[]},{"id":"d1fac03c.caffa","type":"mqtt in","z":"c3d8d21d.ac538","name":"Respond To Water Action Messages","topic":"Action/Water","qos":"2","broker":"6c2a304d.9c27c","x":441.0002212524414,"y":347.00010776519775,"wires":[["77c36683.38f2a8","1117f657.8b078a"]]},{"id":"77c36683.38f2a8","type":"function","z":"c3d8d21d.ac538","name":"Water indicated area","func":"msg.topic = 'tasmota/sonoff-mypump' + msg.payload + '/cmnd/Power1';\nmsg.payload  = 1;\nreturn msg;","outputs":1,"noerr":0,"x":776.000244140625,"y":349.0000925064087,"wires":[["23462d35.8772e2"]]},{"id":"23462d35.8772e2","type":"mqtt out","z":"c3d8d21d.ac538","name":"Issue water command","topic":"","qos":"","retain":"","broker":"ae8b7594.28f7f8","x":1049.0002059936523,"y":348.00012969970703,"wires":[]},{"id":"e7771789.cb44a8","type":"mqtt in","z":"c3d8d21d.ac538","name":"Respond to warnings issued","topic":"Warning/Plants/#","qos":"2","broker":"ae8b7594.28f7f8","x":422.0002136230469,"y":400.0000915527344,"wires":[["1117f657.8b078a"]]},{"id":"1117f657.8b078a","type":"function","z":"c3d8d21d.ac538","name":"construct email warning","func":"msg.topic = msg.topic + ' ' + msg.payload ;\nmsg.payload = 'Dear Sucker,  your getting this cos NodeRedAdmin@PizeroW0 has you on the naughty list';\nreturn msg;","outputs":1,"noerr":0,"x":785.0002746582031,"y":399.0000972747803,"wires":[["e71bb8e1.1f58f8"]]},{"id":"bf131aa5.342e28","type":"Xiaomi BLE","z":"c3d8d21d.ac538","name":"Miflora","address":"","scanningTimeout":60,"x":563,"y":246,"wires":[["9b4c06d9.1a8158"]]},{"id":"97465930.dac538","type":"inject","z":"c3d8d21d.ac538","name":"Plant7 inj","topic":"Plant7","payload":"c4:7c:8d:62:10:ad","payloadType":"str","repeat":"3600","crontab":"","once":true,"onceDelay":"1800","x":104.01953125,"y":379.00394344329834,"wires":[["1d99d60c.b4c55a"]]},{"id":"67194ebe.24bad","type":"mqtt in","z":"c3d8d21d.ac538","name":"Plant Notifications","topic":"Notify/Plant/#","qos":"2","broker":"a368882b.be65d8","x":213.00012969970703,"y":839.0390968322754,"wires":[["77778f05.6f8ab"]]},{"id":"77778f05.6f8ab","type":"function","z":"c3d8d21d.ac538","name":"order plant metrics","func":"//Requires:\n// message with a numeric payload and topic in the \n// format Notify/Plant/X/Y where X ia a numeric id of \n// a sensor/plant area, and Y is a code indicating the\n// metric the payload represents\n//Returns:\n// a message in the format\n// PlantX\\payload sent to the graph as indicated\n// by the metric code the payload containing the data\n//Results:\n//  no expected side effects beyond\n// the relevant graphs should get updated with \n// the new data.\nvar plantnum =  msg.topic.split(\"/\")[2];\nvar Metric =  msg.topic.split(\"/\")[3];\nmsg.topic = msg.topic.split(\"/\")[1]+ plantnum;\n// 4 x outputs 1 moisture metric = M\n// Battery level metric = B\n// Temperature metric = T\n// EC Metric = EC\n// return[msg1,msg2,msg3,msg4]\nswitch(Metric) {\n    case 'M': // moisture\n        return [msg,null,null,null]\n        break;\n    case 'B': //attery level\n         return [null,msg,null,null]\n        break;\n    case 'T': // Temperature\n        return [null,null,msg,null]\n        break;\n    case 'EC': // EC\n         return [null,null,null,msg];\n        break;\n    default:\n    return msg;\n}","outputs":4,"noerr":0,"x":459.00012969970703,"y":839.039080619812,"wires":[["65cec4e0.c104ec"],["e31e5024.22819"],["c5505726.221e58"],["330322a6.79076e"]],"outputLabels":["Mosture","Battery Level","Temperature","EC"]},{"id":"e71bb8e1.1f58f8","type":"e-mail","z":"c3d8d21d.ac538","server":"smtp.gmail.com","port":"465","secure":true,"name":"hunnimonstr@yahoo.com","dname":"NodeRedAdmin","x":1026.0001258850098,"y":399.0000514984131,"wires":[]},{"id":"82d412e6.1ce11","type":"inject","z":"c3d8d21d.ac538","name":"","topic":"Testing testing","payload":"123456789","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":435.0000991821289,"y":454.0000591278076,"wires":[["1117f657.8b078a"]]},{"id":"d5e49fb5.3409c","type":"catch","z":"c3d8d21d.ac538","name":"All Exceptions1","scope":null,"x":381.00001525878906,"y":112.00000071525574,"wires":[["ab656cf6.eebfe"]]},{"id":"4b70c1ed.e4293","type":"status","z":"c3d8d21d.ac538","name":"Miflora Node Status","scope":["bf131aa5.342e28"],"x":390,"y":157.20701599121094,"wires":[["4d84b4f6.2c077c"]]},{"id":"ab656cf6.eebfe","type":"debug","z":"c3d8d21d.ac538","name":"Debug1","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","x":1005.0000152587891,"y":103.00000476837158,"wires":[]},{"id":"4d84b4f6.2c077c","type":"switch","z":"c3d8d21d.ac538","name":"Failure test ","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"no data","vt":"str"},{"t":"eq","v":"not found","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":578.0001220703125,"y":157.20703125,"wires":[["878c53ad.82ba5"],["878c53ad.82ba5"]]},{"id":"878c53ad.82ba5","type":"change","z":"c3d8d21d.ac538","name":"Prepare to Re-Poll","rules":[{"t":"set","p":"payload","pt":"msg","to":"mac","tot":"flow"},{"t":"set","p":"address","pt":"msg","to":"mac","tot":"flow"},{"t":"set","p":"trycount","pt":"flow","to":"$flowContext('trycount') +1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":778.8867950439453,"y":159.46873569488525,"wires":[["3a89e331.87d35c"]]},{"id":"1d99d60c.b4c55a","type":"change","z":"c3d8d21d.ac538","name":"Prepare to Poll","rules":[{"t":"set","p":"address","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"mac","pt":"flow","to":"payload","tot":"msg"},{"t":"set","p":"plant","pt":"flow","to":"topic","tot":"msg"},{"t":"set","p":"trycount","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":384.89453887939453,"y":246.2695255279541,"wires":[["bf131aa5.342e28"]]},{"id":"3a89e331.87d35c","type":"switch","z":"c3d8d21d.ac538","name":"Limit Retries","property":"trycount","propertyType":"flow","rules":[{"t":"lte","v":"3","vt":"num"}],"checkall":"true","repair":true,"outputs":1,"x":1008.8907318115234,"y":159.00000381469727,"wires":[["bf131aa5.342e28"]]},{"id":"e2915821.2a81e8","type":"persist in","z":"c3d8d21d.ac538","name":"PlantMoisture","storageNode":"e2fd001c.c7677","x":1043.000202178955,"y":725.0391216278076,"wires":[]},{"id":"49d72841.768898","type":"persist in","z":"c3d8d21d.ac538","name":"BatteryLevel","storageNode":"d062dc20.7217b","x":1032.0001239776611,"y":778.0390672683716,"wires":[]},{"id":"da8e890e.6ab1a8","type":"persist in","z":"c3d8d21d.ac538","name":"PlantTemperature","storageNode":"42a8b7b8.d63598","x":1052.0001220703125,"y":884.0390815734863,"wires":[]},{"id":"aa65de30.44c3c","type":"persist in","z":"c3d8d21d.ac538","name":"Plant EC","storageNode":"d0a2b159.06af3","x":1020.0001201629639,"y":924.0390663146973,"wires":[]},{"id":"b88c2080.4729c","type":"persist out","z":"c3d8d21d.ac538","name":"PlantMoisture","storageNode":"e2fd001c.c7677","x":229.00018310546875,"y":748.039083480835,"wires":[["65cec4e0.c104ec"]]},{"id":"5f6849d9.4a1348","type":"persist out","z":"c3d8d21d.ac538","name":"BatteryLevel","storageNode":"d062dc20.7217b","x":219.00013732910156,"y":786.0390815734863,"wires":[["e31e5024.22819"]]},{"id":"9e05ef14.6632d","type":"persist out","z":"c3d8d21d.ac538","name":"PlantTemperature","storageNode":"42a8b7b8.d63598","x":236.0001564025879,"y":894.0391063690186,"wires":[["c5505726.221e58"]]},{"id":"75a53003.3ef03","type":"persist out","z":"c3d8d21d.ac538","name":"PlantEC","storageNode":"d0a2b159.06af3","x":205.0001564025879,"y":933.0390911102295,"wires":[["330322a6.79076e"]]},{"id":"65cec4e0.c104ec","type":"ui_chart","z":"c3d8d21d.ac538","name":"Moisture","group":"9bd2a697.f535d8","order":1,"width":"24","height":"6","label":"Moisture","chartType":"line","legend":"true","xformat":"auto","interpolate":"linear","nodata":"waiting","dot":true,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"1000","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":true,"x":688.000186920166,"y":745.0390820503235,"wires":[["e2915821.2a81e8"],[]],"outputLabels":["persistant store",""]},{"id":"e31e5024.22819","type":"ui_chart","z":"c3d8d21d.ac538","name":"","group":"9bd2a697.f535d8","order":4,"width":"24","height":"6","label":"Batery Level %","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"0","ymax":"106","removeOlder":1,"removeOlderPoints":"1000","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":true,"x":704.0001277923584,"y":785.0390787124634,"wires":[["49d72841.768898"],[]],"outputLabels":["persistant store",""]},{"id":"c5505726.221e58","type":"ui_chart","z":"c3d8d21d.ac538","name":"","group":"9bd2a697.f535d8","order":2,"width":"24","height":"6","label":"Temperature","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"5","ymax":"45","removeOlder":1,"removeOlderPoints":"1000","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":true,"x":694.0001850128174,"y":892.0391092300415,"wires":[["da8e890e.6ab1a8"],[]],"outputLabels":["persistant store",""]},{"id":"330322a6.79076e","type":"ui_chart","z":"c3d8d21d.ac538","name":"","group":"9bd2a697.f535d8","order":3,"width":"24","height":"6","label":"EC","chartType":"line","legend":"true","xformat":"auto","interpolate":"linear","nodata":"","dot":true,"ymin":"0","ymax":"","removeOlder":1,"removeOlderPoints":"1000","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":true,"x":676.0001220703125,"y":933.0390939712524,"wires":[["aa65de30.44c3c"],[]],"outputLabels":["persistant store",""]},{"id":"ae8b7594.28f7f8","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"6c2a304d.9c27c","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"a368882b.be65d8","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"e2fd001c.c7677","type":"persist-store","z":"","filename":"moisture.json","interval":"100"},{"id":"d062dc20.7217b","type":"persist-store","z":"","filename":"batterylevel.json","interval":"90"},{"id":"42a8b7b8.d63598","type":"persist-store","z":"","filename":"temperature.json","interval":"80"},{"id":"d0a2b159.06af3","type":"persist-store","z":"","filename":"electroconductivity.json","interval":"60"},{"id":"9bd2a697.f535d8","type":"ui_group","z":"","name":"PC","tab":"2956ec1.813c114","disp":true,"width":"24","collapse":false},{"id":"2956ec1.813c114","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

Allycat
Posts: 30
Joined: Fri Dec 07, 2012 7:13 pm
Location: Bridgend, S.Wales

Re: Hydroponics web interface

Sat Jul 13, 2019 9:57 am

Xiaomi mi flower wont pair with raspberry pi 4. Not getting anywhere with getting this to work. I'm not really up on Linux, so struggling with all the instructions I've found on the subject. Best thing I can think of is if someone who has this already got this working could send me a an image of their sd card and I can try and understand how it all works. I know this is a big ask so any help would be greatly appreciated.

PhatFil
Posts: 1424
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Hydroponics web interface

Sun Jul 14, 2019 3:17 pm

Allycat wrote:
Sat Jul 13, 2019 9:57 am
Xiaomi mi flower wont pair with raspberry pi 4. Not getting anywhere with getting this to work. I'm not really up on Linux, so struggling with all the instructions I've found on the subject. Best thing I can think of is if someone who has this already got this working could send me a an image of their sd card and I can try and understand how it all works. I know this is a big ask so any help would be greatly appreciated.
which guide are you following and at which step do you have an issue?

all methods i have used to query the xiaomi devices involves determining their mac address through the cli hcilescan as detailed in
https://github.com/ThomDietrich/miflora-mqtt-daemon
and
https://zsiti.eu/xiaomi-mijia-hygrother ... pberry-pi/

after which its just a case of editing the scripts or config files/objects to look for the relevant mac addresses and go..

IF YOU HAVE USED THE XIAOMI APP AT ANY STAGE WITH A SENSOR ITS VERY POSSIBLE THE SENSOR FIRMWARE HAS BEEN AUTOMATICALLY UPDATED TO BLOCK ACCESS THIS WAY..

BUT if your problems are with blue tooth on the Pi4? Then its a far more generic issue that could warrant its own post to enlist wider aid..

As Buster/raspbian is a necessary upgrade for the PI4 , im afraid my current stretch image wouldnt be of much use.. and I am holding back on the upgrade for at least a few weeks as it is currently recommended to reinstall a new system rather than upgrade which is a bit more involved than running a couple of cli apt commands.

Allycat
Posts: 30
Joined: Fri Dec 07, 2012 7:13 pm
Location: Bridgend, S.Wales

Re: Hydroponics web interface

Tue Jul 16, 2019 3:54 pm

Thanks PhatFil, I'll look into it further.

Return to “Automation, sensing and robotics”