{"id":18994393,"url":"https://github.com/hormcodes/smart-home-talk","last_synced_at":"2026-02-27T18:35:05.846Z","repository":{"id":220662197,"uuid":"172533349","full_name":"HormCodes/smart-home-talk","owner":"HormCodes","description":"Sources for \"live coding demo\" for talk about Smart Home","archived":false,"fork":false,"pushed_at":"2020-03-05T15:50:01.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-01T15:42:18.251Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HormCodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-02-25T15:36:08.000Z","updated_at":"2020-03-05T15:50:03.000Z","dependencies_parsed_at":"2024-02-03T13:30:40.084Z","dependency_job_id":"0e10b86b-abf7-4e2c-9602-082eb7653d51","html_url":"https://github.com/HormCodes/smart-home-talk","commit_stats":null,"previous_names":["hormcodes/smart-home-talk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HormCodes%2Fsmart-home-talk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HormCodes%2Fsmart-home-talk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HormCodes%2Fsmart-home-talk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HormCodes%2Fsmart-home-talk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HormCodes","download_url":"https://codeload.github.com/HormCodes/smart-home-talk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240009520,"owners_count":19733503,"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","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":"2024-11-08T17:25:26.946Z","updated_at":"2026-02-27T18:35:00.804Z","avatar_url":"https://github.com/HormCodes.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Home Talk\nZdroje pro \"live coding demo\" v rámci přednášky [\"Smart Home Trochu jinak\"](https://docs.google.com/presentation/d/1UTx008-0oevkyYd32_VD9X9rcYITUUmxR5z1AW7NzI0/edit?usp=sharing)...\n\n## Home Assistant\n\nPokud instalujete na Raspberry Pi, doporučuji jako hassbian image, ale je možný i Docker (ten lze nainstalovat podle [tohoto návodu](https://docs.docker.com/install/)): \n\n```\ndocker run -d --name=\"home-assistant\" -v `pwd`/config:/config -e \"TZ=Europe/Prague\" -p 8123:8123 homeassistant/home-assistant\n```\n\nTímto příkazem si vytvoříme docker container s prolinkovanou složkou konfigurace. Pokud vše proběhlo správně, měla by se vám vytvořit složka `config` a na `localhost:8123` by platforma měla běžet. \n\n## Sensory\n\n### Světla\n\nPouze jako demo. Do `configuration.yaml` vložíme tyto řádky:\n\n```yaml\nlight:\n  - platform: demo\n```\n\nZkontrolujeme konfiguraci a restartujeme platformu...\n\n### Teplota, Termostat, Spínání kotle...\n\nPod `sensor:` přidáme:\n```yaml\n  - platform: demo\n  - platform: demo\n```\nZkontrolujeme konfiguraci a restartujeme platformu...\n\nVytvoříme průměrnou teplotu. Opět pod `sensor:` přidáme:\n\n```yaml\n  - platform: template\n    sensors:\n      average_temperature:\n      unit_of_measurement: \"°C\"\n      value_template: \u003e-\n        {{ (float(states.sensor.outside_temperature.state) + float(states.sensor.outside_temperature_2.state)) / 2 | round(2) }}\n```\nZkontrolujeme konfiguraci a restartujeme platformu...\n\nZobrazila se vám chyba v konfiguraci? Pokud ano, opravíme a opět restartujeme...\n\nPřidáme komponentu pro spínání kotle (normálně jako GPIO, nyní jako boolean komponentu):\n```yaml\ninput_boolean:\n  heating_enabled:\n```\n\nZkontrolujeme konfiguraci a restartujeme platformu...\n\nPřidáme termostat: \n```yaml\nclimate:\n  - platform: generic_thermostat\n    name: Thermostat\n    heater: input_boolean.heating_enabled\n    target_sensor: sensor.average_temperature\n    min_temp: 10\n    target_temp: 26\n    cold_tolerance: 0.5\n    hot_tolerance: 0\n    initial_operation_mode: \"auto\"\n```\nJméno termostatu tvoří pak následně jeho `entity_id`. \n\nZkontrolujeme konfiguraci a restartujeme platformu...\n\n## Skupiny\n\nNěkteré skupiny jsou v základu vytvořené nebo si můžeme vytvářet vlastní v souboru `groups.yaml`: \n```yaml\nthermostats:\n  view: false\n  entities: \n    - climate.thermostat\n```\n## Uživatelské rozhraní\n\nPro GUI využijeme modul `Lovelace GUI`. Ten nám dovolí GUI konfigurovat opět pomocí psané konfigurace...\n\nPřidáme:\n```yaml\nlovelace:\n  mode: yaml\n  ```\n\nA vytvoříme nový soubor `ui-lovelace.yml`:\n```yaml\ntitle: Our Home\nviews:\n  - title: Home\n    path: default\n    cards: \n      - type: thermostat\n        entity: climate.thermostat\n        name: Bedroom\n      - type: horizontal-stack\n        cards:\n          - type: light\n            name: Bedroom\n            entity: light.bed_light\n          - type: light\n            name: Kitchen\n            entity: light.kitchen_lights\n      - type: history-graph\n        entities: \n          - entity: sensor.average_temperature\n            name: Average Temperature\n          - entity: sensor.outside_temperature\n            name: Outside Temperature\n        hours_to_show: 48\n        title: Temperature last 2 days\n  - title: Domov\n    path: default\n    cards: \n      - type: thermostat\n        entity: climate.thermostat\n        name: Ložnice\n      - type: horizontal-stack\n        cards:\n          - type: light\n            name: Ložnice\n            entity: light.bed_light\n          - type: light\n            name: Kuchyně\n            entity: light.kitchen_lights\n      - type: history-graph\n        entities: \n          - entity: sensor.average_temperature\n            name: Průměrná teplota\n          - entity: sensor.outside_temperature\n            name: Venkovní teplota\n        hours_to_show: 48\n        title: Teploty za poslední 2 dny\n        \n```\n\nZkontrolujeme konfiguraci a restartujeme platformu (a možná budeme muset v nastavení Lovelace aktivovat)...\n\n## Automatizace\n\n### Spuštění na základě změny stavu\n```yaml\n- alias: 'Light state change sets wanted temperature'\n  trigger:\n    platform: state\n    entity_id: light.bed_light\n  action: \n    - service: climate.set_temperature\n      data_template:\n        entity_id: \n          - group.thermostats\n        temperature: 22\n```\n\n### Spuštění na základě změny času...\n```yaml\n- alias: 'Afternoon'\n  trigger:\n    platform: time_pattern\n    hours: '/1'\n  condition:\n    condition: 'time'\n    after: '16:00:00'\n    before: '22:00:00'\n  action: \n    - service: climate.set_temperature\n      data_template:\n        entity_id: \n          - group.thermostats\n        temperature: 25\n```\n\n## Export Dat\n\n```bash\n$ sqlite3 config/home-assistant_v2.db\n```\n\n```sql\nselect state,created from states where entity_id = \"sensor.average_temperature\";\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhormcodes%2Fsmart-home-talk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhormcodes%2Fsmart-home-talk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhormcodes%2Fsmart-home-talk/lists"}