Open mattmac24 opened 1 year ago
That sounds like a great feature! However, I'm currently quite busy with other things in my life (and heating season should be over any day now đ ). Feel free to submit a PR, otherwise it might take some time for me to get around to working on this plugin again.
No worries, I did a super dirty way to get this working using my limited abilities. If you don't mind, I am going to paste my process below for both my own reference and if somebody else wants to do the same. I am sure there are 100 better ways, but this works for me using x86_64 ubuntu 22.04 server.
Setup Node server(link) sudo npm install -g json-server
. I had to install node.js first with sudo apt install Node.js
Autostart node server by adding below command to /etc/rc.local
/usr/local/bin/json-server -H 192.168.0.5 -p 3000 /home/matthew/db.json
sudo chmod +x /etc/rc.local
create ~/db.json:
{ "AlexTempâ: { "temperature": 20.0 }, âJuliaTempâ: { "temperature": 20.0 } }
Install this http-thermostat homebridge plug-in
Replace contents of /var/lib/homebridge/node_modules/@piets/homebridge-http-thermostat/dist/index.js with this
Install Homebridge Cron Scheduler HomeBridge plug-in
Setup cron 5 second timer using this: 0/5 * * * * *
setup homekit automation to be triggered by the 5 second timer created in step 8
I want to read the current temperature from the JSON server but allow the target temperature to be user configurable. Currently, these two values are always set to the same temperature, which is read from the JSON.
If this can be achieved, I can feed the current temperature value via JSON and then adjust the Target temperature in Apple homekit. I then have an homekit automation running every five seconds to turn my dumb electric heater on/off using a smart switch by comparing the target and current temperature. This automation also writes the current temperature to the json server after reading it from a temperature sensor.
Bonus: Off & Heat modes