{"id":23922607,"url":"https://github.com/datenhahn/cosilino-device","last_synced_at":"2025-09-01T05:33:31.099Z","repository":{"id":215468857,"uuid":"122673851","full_name":"datenhahn/cosilino-device","owner":"datenhahn","description":"ESP8266 IoT device to control electric heatings","archived":false,"fork":false,"pushed_at":"2018-10-03T18:47:42.000Z","size":923,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T22:28:18.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datenhahn.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-23T21:19:49.000Z","updated_at":"2018-10-03T18:47:43.000Z","dependencies_parsed_at":"2024-01-04T16:44:01.391Z","dependency_job_id":null,"html_url":"https://github.com/datenhahn/cosilino-device","commit_stats":null,"previous_names":["datenhahn/cosilino-device"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/datenhahn/cosilino-device","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fcosilino-device","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fcosilino-device/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fcosilino-device/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fcosilino-device/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datenhahn","download_url":"https://codeload.github.com/datenhahn/cosilino-device/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fcosilino-device/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273077227,"owners_count":25041358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-05T17:15:23.516Z","updated_at":"2025-09-01T05:33:31.065Z","avatar_url":"https://github.com/datenhahn.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cosilino - Remote control Stiebel Eltron electronic heating applicances (ETS200-700) via MQTT\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-red.svg)](https://opensource.org/licenses/MIT)\n\n## Introduction\n\nWe live in an apartment fitted with these electronic heaters. They have two problems (besides\nthe generally bad efficency of electric heating):\n\n1. They have one day of ineratia (they heat only at night and then keep the heat over a\n   whole day). This means if the next day is unusually warm and you forget to switch them\n   off the appartment is overheated the whole day. And in reverse, if you forget to switch\n   them on, you have no way of \"adhoc-heat\".\n2. The minimal setting is too hot for the transition seasons (autum, spring).\n\nA colleague pointed me to the nice ESP8266 development board (thanks Ivan!) and with some\ntemperature sensors and a servo it is easy to turn this 15 year old heater into a fancy\nIoT-device.\n\nFirst I tried to use the DC control port which is powered by a DC current between\n0.9 - 1.4 Volt , but then I ditched that idea because it would have required opening\nthe heater and fiddling with its internals which I didn't want to do (too risky).\n\nThe easy workaround was to just turn the max heat knob with a servo.\n\nI 3D-printed the part to hold the servo with a cheap 40€ 3D print\npen which uses the normal 1,75mm PLA filament. It doesn't look nice\nbut it does the job. It is connected to the heating with magnets\n(which I stole from my son's toy box).\n\nThe device's casing is way too big. This is the first prototype, so\nI wanted to have some space to play around. Also I used an additional\nNodeMCU breakout-board which makes using normal bread-board-connectors\n more convenient.\n\n![Device installed](doc/images/device_installed.jpg)\n\n![Device installed](doc/images/device.jpg)\n\n![Device installed](doc/images/device_open.jpg)\n\n### Watch in action\n\n[![cosilino-video](https://img.youtube.com/vi/otGSGF0wK6k/0.jpg)](https://www.youtube.com/watch?v=otGSGF0wK6k)\n\n## cosilino-device\n\nI built and flashed the firmware with the Arduino IDE. This folder contains the Arduino IDE ino-file for the device.\n\nThe device uses the WifiManager arduino lib (https://github.com/tzapu/WiFiManager).\nIf it cannot connect to a Wifi all LEDs will be on. You then can\nconnect to the devices accesspoint ( look for \"cosilino-...) (... == deviceid).\n\nYou might have to adjust the mqtt server to your hostname/ip before\nflashing.\n\n    #define MQTT_SERVER \"cosilino-gateway\"\n\nexample for different ip:\n\n    #define MQTT_SERVER \"192.168.123.33\"\n\n### Anroid IDE plugins\n\nI screenshotted all plugins I installed (see doc/arduino_ide_plugins).\n\n### Material List\n\n* ESP8266 (NodeMCU 1.0)\n* Tower SG90 Micro Servo\n* DHT-22 Temperature and Humidity-Sensor\n* DS18S20 Temperature Sensor\n* 1x red, 1x yellow, 1x green LEDs\n* 3x 220Ohm resistor (for LEDs)\n* 1x 1k Ohm resistor (pullup DHT-22)\n* 1x 4,7k Ohm resistor (pullup DS18S20)\n* RaspberryPi or any other permanently running pc (for MQTT broker + mongodb)\n\n### Schematics\n\nYou find the fritzing file, schematics and plan in doc/fritzing.\n\n![schematics](doc/fritzing/cosilino-device-plan_Schaltplan.png)\n\n![plan](doc/fritzing/cosilino-device-plan_Steckplatine.png)\n\n## cosilino-backend\n\nI used a raspberrypi with mosquitto and mongodb as backend.\n\n```\napt-get install mosquitto mongodb-server\n```\n\nYou might want to enable mongodb to your internal network by\ncommenting out\n\n/etc/mongodb.conf\n\n    #bind_ip = 127.0.0.1\n\nThen restart mongodb (`/etc/init.d/mongodb restart`)\n\n\n### Get and set heat\n\nYou can connect to all topics on the broker for debugging purposes.\n`-v` also prints the topic names.\n\n#### Read status messages\n\n    $\u003e mosquitto_sub -v -t \"#\"\n    cosilino/171d45/status {\"deviceId\":\"171d45\",\"roomHum\":51.80,\"roomTemp\":22.30,\"heaterTemp\":-127.00,\"heaterPower\":0}\n\n#### Set heating level\n\nFor now I didn't implement any awesome logic. I just set up a cronjob\nto switch the heater on for 1-2 hours at night. In winter it is on\nall the time anyway and in summer off all the time. Of course a nice\nautomatic adjustment using a weather forecast would be nice (see todo).\n\nActually the percentage values aren't to helpful. In the end I controled\nthe heat by how long I set the heater to 100% (which is actually 66% as\nthe servo doesn't turn 270° but only 180°).\n\nFor me 1-2 hours per night was enough during autum/spring.\n\n    $\u003e mosquitto_pub -t \"cosilino/171d45/heaterpower\" -m 0\n    $\u003e mosquitto_pub -t \"cosilino/171d45/heaterpower\" -m 100\n\nExample cronjobs\n\n```\n$\u003e crontab -l\n# For more information see the manual pages of crontab(5) and cron(8)\n#\n# m h  dom mon dow   command\n\n#0 21 * * * mosquitto_pub -h cosilino-gateway -t cosilino/171d45/heaterpower -m 100\n#45 21 * * * mosquitto_pub -h cosilino-gateway -t cosilino/171d45/heaterpower -m 0\n#10 1  * * * mosquitto_pub -h cosilino-gateway -t cosilino/171d45/heaterpower -m 100\n#30 1  * * * mosquitto_pub -h cosilino-gateway -t cosilino/171d45/heaterpower -m 0\n#40 4 * * * mosquitto_pub -h cosilino-gateway -t cosilino/171d45/heaterpower -m 100\n#0 5 * * * mosquitto_pub -h cosilino-gateway -t cosilino/171d45/heaterpower -m 0\n```\n\n### Pumping data into mongodb\n\nI just run the backend in screen.\n\n    apt-get install screen\n    screen\n    ./cosilino-backend.py\n\nYou might have to install an **older version of pymongo** as the mongodb version\nwhich comes with raspbian is quite old (2.4..) .\n\n## cosilino-mathplot\n\nThe plans to build a shiny webui were there, but for now I just built a\nminimal gtk interface with mathplot lib.\n\nYou might have to install an **older version of pymongo** as the mongodb version\nwhich comes with raspbian is quite old (2.4..) .\n\n    ./cosilino-draw.py\n\n![stats example](doc/images/mathplotlib-example.png)\n\n## Todo\n\nThe real plan was to dynamically set the heat level depending on the\nnext days weather and condition (sun/clouds).\n\nAnd of course it should be possible to access and control the devices\nfrom the phone. So a nice webui should follow.\n\n* add auto tune by getting weather forecast: https://openweathermap.org/\n* add mobile-friendly webui\n\n## Other resources\n\nIf you are interested in learning more about the heaters specs, have a look at the manual.\n\nhttps://www.stiebel-eltron.com/content/dam/ste/cdbassets/current/bedienungs-_u_installationsanleitungen/ETS_200-700__89e3d3f0-fcf7-11e6-a5ac-005056a95add.pdf\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatenhahn%2Fcosilino-device","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatenhahn%2Fcosilino-device","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatenhahn%2Fcosilino-device/lists"}