Software #
- Raspbian OS
- Main services
- Mosquitto : https://mosquitto.org/
- influxDB : https://www.influxdata.com/products/influxdb-overview/
- mqtt2influx : py/influx
- Grafana : https://grafana.com/
- graphql sensors : js/graphql
- x to mqtt
- Zigbee2mqtt : https://www.zigbee2mqtt.io/
- nrf2mqtt : github nRF52_Mesh nrf_mesh
- miflora2mqtt : https://github.com/RaymondMouthaan/miflora-mqtt-daemon
- telegram bots2mqtt : js/telegraf based on https://github.com/telegraf/telegraf
- automation services
- Light control : py/hue
- Phantom Load cut : js/pc_control
- Heat cut : py/heating
- Home status : py/home_status
- Roborock button : py/hover
- user interface
- 3D webapp : https://github.com/HomeSmartMesh/smart_home_3d_webapp
- Led panel : js/leds_panel
- Bed heating : js/bed_heating
- Roborock Chat : js/telegraf/hover_poll.js
Hardware #
- Zigbee
- Hue Light with Hue gateway
- Eurotronics thermostats with zigbee2mqtt
- Aquara sensors with Zigbee2mqtt
- WiFi
- ESP32 bed heater
- ESP32 neopixels led panel
- Shelly power control and monitor
- Roborock with valetudeo server : https://github.com/Hypfer/Valetudo
- Custom RF
- nRF52 sensors with nRF52 Mesh
- ESP32
- led panel : github esp32_iot rgb_led
- bed heating github esp32_iot bed_heater
Meta website #
What is it ? #
- Hugo : a website as easy to customise as writing markdown
- Menu : All webapps and websites can be organised in a hierarchical menu
- Full screen : Each website is embedded on an iframe that can toggle to full screen mode or open in a new page
How does it work ? #
- create a new file :
homeassistant.md
- call
hugo server
to test orhugo
to generate the website (more details on using hugo) - this will already create a new menu entry
- Fill it with the link to your webapp instance
weight
: defines the order in the menu entrytitle
: The text that will appear on the menu entryBookToC
: Table Of Content not required so that the iframe can be wider...{< iframe...
: call of theiframe
html shortcode file that has been added in thelayouts\shortcodes
directory
Demo video #
Smart home 3D webapp #
Attempt to unify interfaces in one app. Result is quite a success though requires a beast GPU and quite some effort to arrange 3D details and camera positioning to get a nice user experiance out of it.
- Has it’s own github repo : https://github.com/HomeSmartMesh/smart_home_3d_webapp
- Hackaday project : https://hackaday.io/project/169046-smart-home-3d-webapp
- Even a Hackaday Blog entry : https://hackaday.com/2019/12/29/the-smart-home-gains-an-extra-dimension/
Led Panel webapp #
- Hackaday project : https://hackaday.io/project/162825-neopixels-animations-on-esp32-mqtt-json-webapp
Home heating app #
web heat control #
The control of the heating has a feedback that ensures the execution of the command. The green displayed numbers represent the time since the last status of the zigbee device. Once a slider is modified and a command is sent, a feedback shall be received within few seconds and the time since last message should drop to 0 mn
python heat windows monitor #
- adjust your mqtt configuration in config.json
- adjust the eurotronic heater topic and apertures (apertures are the contact sensors list)
"heatings":{
"living heat":{
"topic":"lzig/living heat/set",
"Apertures":[
"balcony door",
"balcony window right",
"balcony window left"
]
}
}
- add the contact sensors to the mqtt subscriptions as well
- run the script
python raspi/heat.py
example eurotronic mqtt payload
zig/living heat {
"current_heating_setpoint":17,
"eurotronic_system_mode":1,
"local_temperature":18.49,
"occupied_heating_setpoint":21,
"unoccupied_heating_setpoint":16,
"eurotronic_error_status":0,
"pi_heating_demand":0,
"battery":100,
"linkquality":44
}
docu references #
- slider editing web page
- slider css docu
- https://www.w3schools.com/jsref/dom_obj_event.asp
- https://www.w3schools.com/jsref/dom_obj_all.asp
- https://patrickhlauke.github.io/touch/
- on release working : https://codepen.io/mhartington/pen/HKGno
Bed Heating app #
- web app : js/bed_heater
Bed Heating hardware #
- ESP32 firmware : github esp32_iot bed_heater
- using a Shelly 1 pm : https://shelly.cloud/shelly-1pm-wifi-smart-relay-home-automation/
- A standard off the shelf bed heating matrass
- A Solid state relay
Roborock chat #
- using the amazing node.js telegraf framework : https://github.com/telegraf/telegraf
- Roborock Chat : js/telegraf/hover_poll.js
Hue Light control #
- Controls all the Hue light bulbs from Aquara sensor switches using the HUE rest API
- custom functions
- Long press for minimal dimming
- Toggle on of or Toggle dim states
Config example. Click for details...
{
"bridges":{
"LivingRoom":"10.0.0.38",
"username_config":"/home/pi/.python_hue"
},
"mqtt":{
"host":"10.0.0.42",
"port":1883,
"keepalive":60,
"client_id":"hue_client",
"subscriptions":[
"mzig/bed light button",
"mzig/bed nic button",
"mzig/living double switch",
"lzig/bedroom switch",
"lzig/volume white",
"lzig/office switch",
"lzig/hallway entrance switch",
"lzig/hallway living switch",
"lzig/hallway corridor switch"
],
"actions" :[],
"publish" :true,
"subscribe" :true
},
"lightmap":{
"hallway":{
"action":"light_list_clicks",
"sensors":[
"hallway entrance switch",
"hallway living switch",
"hallway corridor switch"
],
"lights":[
"Entrance White 1",
"Entrance White 2",
"Entrance White 3"
]
}
},
"log":{
"logfile":"/home/pi/share/hue(date).log",
"level":"Info"
}
}
Phantom Load cut #
- Some home devices especially device clusters such as TV sets and surroundings or PC and surroundings do have a significant cumulated power usage when in a standby mode.
- Who likes to pay money for non used electricity ?
- Who likes to keep remembering each time and toggling switching on locations hard to access ?
- This scrips js/pc_control comes to the rescue and does this for you in a smart way.
Features #
- configurable standby power level. For example a TV set with sound system consumes 100 W to 200 W but when on standby, still ~ 11 W
- a shelly socket provides a real time power usage through mqtt
- if the device is in standby < 12 W for more than 5 min, the shelly device is ordered to cut the power resulting in 1 W for the shelly device power usage (wifi connection). Therefore a permanent 10 W is saved.
- Low Motion sensors attached to the chair or to the remote control order the shelly to switch on again. False positive is not a problem and only costs 10W standby consumption for 5 more min before cutting again.
- If the TV started really to be used and power is > 12 W, then the standby power cut system is not doing anything so that the user enjoys watching TV until the next TV switch off cycle.
Heat cut #
-
Hackaday page : Aquara and Eurotronics hand in hand to save energy
-
Opening a window without remembering to switch the heating off can cost a peak of heat that consists of the major power cost of the whole day !
-
The smart detection based on temperature drop is no reliable and only acts late sometimes when not necessary.
-
With a simple aquara contact switch the system is now reliable
-
Python service : py/heating
Home status #
- Leaving home, in a hurry, no time to walk through the house or to start smartphone apps to know if the heating is forgotten in one room or if a window is left open in another.
- With this script, you see the home status right next to the house door before leaving
- Any window is open : The status light is blue
- Any heater is active : The status is red
- Both red and blue can be combined
How does this work. In a controlled environemnt where the wifi is reliable, there is no need for wifi status as it is always on. Therefore the led status disable function can be re-used for another purpose. This provide the nicest integration of led status including power supply, mqtt connection without even blocking the socket for other usage.
Below are the control URLs to turn led color on and off
json Config example. Click for details...
"status":{
"red":{
"on":"http://10.0.0.48/settings/?led_power_disable=false",
"off":"http://10.0.0.48/settings/?led_power_disable=true"
},
"blue":{
"on":"http://10.0.0.48/settings/?led_status_disable=false",
"off":"http://10.0.0.48/settings/?led_status_disable=true"
}
}
Roborock button #
As Roborock valetudo provides an mqtt interface, all it takes is this script py/hover to order cleaning of a room or a section with a click on an aquara zigbee button.
zigbee/graphview #
Features #
- configurable ip, port and mqtt base name
- multiple hosts for those using mulitple zigbee2mqtt instances.
- svg pan zoom for simpleefficient viewing. graphs can be so huge that text gets tiny.
- red buttons for change graph layout algorithm. Depending on the network, some algos can be more convenient than others
Note that the following viewer is hosted on github and has therefore a secure connection that shall not swap to a local home connection.
Inactive hosted page #
In order to use this script, it is required to host it locally on local raspberry py, see deploy script for deployment convenience. Direct usage from the link would require to authorise cross origin on chrome symbol on right of the adress bar.
Logging #
Log.io #
- exposing log files to webapps :
js/log.io/server.json
- https://github.com/NarrativeScience/log.io
transport-browserconsole #
Support #
- I’ll provide support for any question or suggestion on https://github.com/HomeSmartMesh/raspi/issues
Safety warning #
- Power Sockets have deadly voltage and should not be self altered
- Usage of certified products such as Shelly or others is recommended for any high voltage product
- hacking custom scripts to control equipment might improve safety in case you add power cut off to a lower power for each section and device, but might also alter your food if your fridge inadvertantly goes off due to a wrong configuration
- reboot state
- safety power too low
- Any heat power control custom script must necessarily have another safe switch to fully cut the power when away or device is inattended.