Hi,
I have 2 Raspberry Pis. A PI 3 with Pimatic on and a separate one on the same network to which has a number of DS18B20 Temp Sensors attached and values stored in a rrd. What I would like to achieve initially is for Pimatic to be able to also fetch readings from the sensors on the other pi.
In essence, since I already have code that will extract the temperatures from the 1w bus, this problem could be generalised into one of Pimatic issuing commands on a regular basis and storing responses.
Has anyone here already done anything similar?
-
Collecting Temperature Data from another RaspberryPi
-
On the Pi with the DS18B20: send the value to pimatic with a curl command to the API
curl -X PATCH --header "Content-Type:application/json" --user "api:api" --data '{"type": "value", "valueOrExpression": $waterin.temperature}' http://192.168.2.118:82/api/variables/ZwembadWaterIn
Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm
-
Have a look at my Synology Script, should be a good staring point for reverse engineering
-
i think, this is a general issue.
for some situations, i need a function to connect more than one raspberry with pimatic. or is there a solution to set a second raspberry as client?
-
you could ssh from one pi to the other and execute commands. maybe this tutorial helps
http://www.linuxproblem.org/art_9.html
you could use a shellsensor then to execute commands on the other pi or maybe rules or a buttonsdevice.
another possibility would be to mount a directory from pi a on pi b and store a logfile in this directory. then you can use the logreader to parse the log.@schmucke unfortuntely not yet. there are feature requests on that.
actually you can use the api and shellsensor and shellswitch devices or rules to combine two or more pimatic instances.pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
Why dont you use MQTT?
-
@leader21 and others . Many thanks. Some great ideas to follow up - namely: ssh and shared folder. Have used mqtt before and its great but both ends would then need integrating and I feel a lighter weight, more direct solution would be quicker, more generic and possibly easier to implement.
-
Well I think mqtt is one of the best options for moving forward. In the future we may also have pimatic-remote, a solution for connecting to pimatic instances to each other. This might be a simpler alternative, but the project is still in its infancies.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig I have used mqtt before and you are probably right in the longer term. I will look more closely at this option. However, I am just getting started with pimatic and working with headless boxes a long way away - hence desire to take smaller logical steps to get some live data in.