diff --git a/automations.yaml b/automations.yaml index 87d92ed..46477c7 100644 --- a/automations.yaml +++ b/automations.yaml @@ -9,3 +9,13 @@ - service: shell_command.blue_led_off data: {} mode: single +- id: '1686867321964' + alias: Update Map Extractor camera + description: '' + use_blueprint: + path: PiotrMachowski/update_map_extractor.yaml + input: + vacuum: vacuum.roborock_vacuum_s5 + camera: camera.xiaomi_cloud_map_extractor + mode_to_handle: two_intervals + interval_docked: 10000 diff --git a/configuration.yaml b/configuration.yaml index b8d45f5..2094b17 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -14,18 +14,11 @@ google_assistant: project_id: home-assistant-65612 service_account: !include home-assistant-65612-d69ecfd0f735.json report_state: true - exposed_domains: - - switch - - light - entity_config: - switch.kitchen: - name: CUSTOM_NAME_FOR_GOOGLE_ASSISTANT - aliases: - - BRIGHT_LIGHTS - - ENTRY_LIGHTS - light.living_room: - expose: false - room: LIVING_ROOM + +homeassistant: + customize: !include customize.yaml + customize_domain: !include customize_domain.yaml + customize_glob: !include customize_glob.yaml group: !include groups.yaml automation: !include automations.yaml @@ -34,12 +27,18 @@ scene: !include scenes.yaml template: !include template.yaml sensor: !include sensors.yaml input_select: !include input_select.yaml +#var: !include var.yaml http: use_x_forwarded_for: true trusted_proxies: - 192.168.88.10 +logger: + default: info + logs: + custom_components.xiaomi_cloud_map_extractor: debug + # MariaDB - 30 day data recorder: db_url: !secret mariadb_url @@ -75,7 +74,7 @@ light: camera: - platform: xiaomi_cloud_map_extractor - host: 192.168.88.22 + host: !secret xiaomi_vacuum_host token: !secret xiaomi_vacuum_token username: !secret xiaomi_cloud_username password: !secret xiaomi_cloud_password @@ -90,3 +89,9 @@ camera: bottom: 20 left: 20 right: 20 + scan_interval: + seconds: 300 + auto_update: false + store_map_raw: true + store_map_image: true + store_map_path: "/tmp" diff --git a/customize.yaml b/customize.yaml new file mode 100644 index 0000000..e69de29 diff --git a/customize_domain.yaml b/customize_domain.yaml new file mode 100644 index 0000000..07ffd3a --- /dev/null +++ b/customize_domain.yaml @@ -0,0 +1,9 @@ +# Klimatizace +climate: + # hvac_modes: auto, cool, dry, fan_only, heat, off + hvac_modes: + - heat + - cool + - dry + - fan_only + - "off" diff --git a/customize_glob.yaml b/customize_glob.yaml new file mode 100644 index 0000000..e69de29 diff --git a/node-red/.config.nodes.json b/node-red/.config.nodes.json index f30a522..5db96e6 100644 --- a/node-red/.config.nodes.json +++ b/node-red/.config.nodes.json @@ -1,7 +1,7 @@ { "node-red": { "name": "node-red", - "version": "3.0.2", + "version": "3.1.0", "local": false, "user": false, "nodes": { @@ -95,6 +95,17 @@ "module": "node-red", "file": "/opt/node_modules/@node-red/nodes/core/common/90-comment.js" }, + "global-config": { + "name": "global-config", + "types": [ + "global-config" + ], + "enabled": true, + "local": false, + "user": false, + "module": "node-red", + "file": "/opt/node_modules/@node-red/nodes/core/common/91-global-config.js" + }, "unknown": { "name": "unknown", "types": [ @@ -418,7 +429,7 @@ }, "node-red-contrib-bigtimer": { "name": "node-red-contrib-bigtimer", - "version": "2.8.3", + "version": "2.8.5", "local": false, "user": false, "nodes": { @@ -475,7 +486,7 @@ }, "node-red-contrib-home-assistant-websocket": { "name": "node-red-contrib-home-assistant-websocket", - "version": "0.48.0", + "version": "0.57.4", "local": false, "user": false, "nodes": { @@ -498,12 +509,17 @@ "ha-fire-event", "ha-get-entities", "api-get-history", + "ha-number", "poll-state", "api-render-template", + "ha-select", "ha-sensor", + "ha-sentence", "ha-switch", "ha-tag", + "ha-text", "ha-time", + "ha-time-entity", "trigger-state", "ha-update-config", "ha-wait-until", @@ -561,7 +577,7 @@ }, "node-red-contrib-modbus": { "name": "node-red-contrib-modbus", - "version": "5.25.0", + "version": "5.27.2", "local": false, "user": false, "nodes": { @@ -718,12 +734,23 @@ "user": false, "module": "node-red-contrib-modbus", "file": "/opt/node_modules/node-red-contrib-modbus/modbus/modbus-flex-sequencer.js" + }, + "Modbus-Flex-Fc": { + "name": "Modbus-Flex-Fc", + "types": [ + "modbus-flex-fc" + ], + "enabled": true, + "local": false, + "user": false, + "module": "node-red-contrib-modbus", + "file": "/opt/node_modules/node-red-contrib-modbus/modbus/modbus-flex-fc.js" } } }, "node-red-contrib-moment": { "name": "node-red-contrib-moment", - "version": "4.0.0", + "version": "5.0.0", "local": false, "user": false, "nodes": { @@ -772,7 +799,7 @@ }, "node-red-contrib-sunevents": { "name": "node-red-contrib-sunevents", - "version": "3.0.3", + "version": "3.1.1", "local": false, "user": false, "nodes": { @@ -1068,7 +1095,7 @@ }, "node-red-node-email": { "name": "node-red-node-email", - "version": "1.18.4", + "version": "2.0.1", "local": false, "user": false, "nodes": { @@ -1146,7 +1173,7 @@ }, "node-red-node-serialport": { "name": "node-red-node-serialport", - "version": "1.0.1", + "version": "1.0.4", "local": false, "user": false, "nodes": { @@ -1187,7 +1214,7 @@ }, "node-red-node-suncalc": { "name": "node-red-node-suncalc", - "version": "1.0.1", + "version": "1.1.0", "local": false, "user": false, "nodes": { diff --git a/node-red/flows.json b/node-red/flows.json index 4231381..e04ff5c 100644 --- a/node-red/flows.json +++ b/node-red/flows.json @@ -1 +1 @@ -[{"id":"af32a28ba9e46f29","type":"tab","label":"Living room - Main light","disabled":false,"info":"Obývák - hlavní světla\r\n\r\n4x RGB žárovka\r\n1x scene switch\r\n\r\n1-click: toggle\r\n2-click:\r\npush:","env":[]},{"id":"8850e193.e1712","type":"subflow","name":"SaveChart","info":"","category":"","in":[{"x":80,"y":140,"wires":[{"id":"40784bb1.204934"}]}],"out":[{"x":820,"y":120,"wires":[{"id":"a6525d2.cb354a","port":0}]}]},{"id":"e58cc30d.0bb9","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"a07f98a5c7ec3274","type":"mqtt-broker","name":"mosquitto","broker":"core-mosquitto","port":"1883","clientid":"nodered","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"a0f72417.ea2838","type":"file","z":"8850e193.e1712","name":"backup","filename":"","appendNewline":false,"createDir":true,"overwriteFile":"true","x":700,"y":160,"wires":[[]]},{"id":"70a2db09.6ff354","type":"file in","z":"8850e193.e1712","name":"restore","filename":"","format":"utf8","sendError":true,"x":530,"y":120,"wires":[["a6525d2.cb354a"]]},{"id":"922d4285.5f7e1","type":"json","z":"8850e193.e1712","name":"","property":"payload","action":"str","pretty":false,"x":530,"y":160,"wires":[["a0f72417.ea2838"]]},{"id":"a6525d2.cb354a","type":"json","z":"8850e193.e1712","name":"","property":"payload","action":"str","pretty":false,"x":690,"y":120,"wires":[[]]},{"id":"40784bb1.204934","type":"function","z":"8850e193.e1712","name":"LoadSave","func":"var strSafe=msg.topic;\nif(strSafe)\n{\n msg.filename =\"/share/chart.save\";\n var loaded=context.get(strSafe)||0;\n \n if(0===loaded||strSafe==\"restore\")\n {\n //node.warn(\"Loading chart\");\n msg.payload=\"load\";\n context.set(strSafe,1);\n }\n else\n {\n //node.warn(\"Writing chart\");\n //node.warn(msg.payload);\n }\n return msg;\n \n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":230,"y":140,"wires":[["51fb3038.7afb6"]]},{"id":"51fb3038.7afb6","type":"switch","z":"8850e193.e1712","name":"Load data","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"load","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":380,"y":140,"wires":[["70a2db09.6ff354"],["922d4285.5f7e1"]]},{"id":"dbe202dbcec1134a","type":"mqtt in","z":"af32a28ba9e46f29","name":"","topic":"zigbee2mqtt/livingroom/scene_switch","qos":"1","datatype":"json","broker":"a07f98a5c7ec3274","nl":false,"rap":true,"rh":0,"inputs":0,"x":190,"y":60,"wires":[["e73dbc5cf9e4c229","b97b7b166ff889f4"]]},{"id":"e73dbc5cf9e4c229","type":"switch","z":"af32a28ba9e46f29","name":"","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"1_single","vt":"str"},{"t":"eq","v":"2_single","vt":"str"},{"t":"eq","v":"3_single","vt":"str"},{"t":"eq","v":"4_single","vt":"str"},{"t":"eq","v":"1_double","vt":"str"},{"t":"eq","v":"2_double","vt":"str"},{"t":"eq","v":"3_double","vt":"str"},{"t":"eq","v":"4_double","vt":"str"},{"t":"eq","v":"1_hold","vt":"str"},{"t":"eq","v":"2_hold","vt":"str"},{"t":"eq","v":"3_hold","vt":"str"},{"t":"eq","v":"4_hold","vt":"str"}],"checkall":"true","repair":false,"outputs":12,"x":150,"y":400,"wires":[["4fac346c3d066f8f"],["23049ee5d70a7992"],["f66dd231bac152b9"],["c77a5b62ecc09046"],[],[],[],[],[],[],[],[]]},{"id":"5ac058fedde86732","type":"mqtt out","z":"af32a28ba9e46f29","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"a07f98a5c7ec3274","x":1310,"y":140,"wires":[]},{"id":"4860bb0911a4b518","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"zigbee2mqtt/livingroom/main_light_2/set\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":380,"wires":[["19f51c0d8c733dec"]]},{"id":"ebef887b98106c6c","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"zigbee2mqtt/livingroom/main_light_1/set\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":460,"wires":[["77db2ac50a130285"]]},{"id":"77db2ac50a130285","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness\":254,\"color_temp\":463,\"state\":\"ON\"}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":260,"wires":[[]]},{"id":"b5c290e4d668cca3","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"zigbee2mqtt/livingroom/main_light_3/set\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":420,"wires":[[]]},{"id":"166f158e7450c9fc","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"zigbee2mqtt/livingroom/main_light_4/set\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":460,"wires":[[]]},{"id":"b8926c4a994bfe9a","type":"debug","z":"af32a28ba9e46f29","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1290,"y":360,"wires":[]},{"id":"4fac346c3d066f8f","type":"ha-device","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":1,"deviceType":"action","device":"68bc07dee263ff26a97db77cf19fb386","event":{"type":"toggle","device_id":"68bc07dee263ff26a97db77cf19fb386","entity_id":"light.livingroom_mainlight_aquarium","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[],"x":430,"y":140,"wires":[[]]},{"id":"35b67c9fd149c560","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"brightness\": 254,\t \"color_mode\": \"color_temp\",\t \"color_temp\": 454,\t \"state\": state\t}\t\t\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":200,"wires":[["5ac058fedde86732","b8926c4a994bfe9a"]]},{"id":"0884a251ca1add3e","type":"function","z":"af32a28ba9e46f29","name":"","func":"if(msg.payload.state==\"ON\"){\n msg.payload.state=\"OFF\"\n} else {\n msg.payload.state=\"ON\"\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":560,"wires":[[]]},{"id":"739ce27373dcbdf0","type":"inject","z":"af32a28ba9e46f29","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":520,"wires":[[]]},{"id":"e01925178734cf09","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"state\": \"ON\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":220,"wires":[["35b67c9fd149c560"]]},{"id":"b97b7b166ff889f4","type":"debug","z":"af32a28ba9e46f29","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":60,"wires":[]},{"id":"19f51c0d8c733dec","type":"api-current-state","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":3,"outputs":2,"halt_if":"ON","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.0xb4e3f9fffe102c1f","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":650,"y":380,"wires":[["3c9ea731c2cd44a5"],["e01925178734cf09"]]},{"id":"3c9ea731c2cd44a5","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"state\": \"OFF\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":180,"wires":[["35b67c9fd149c560"]]},{"id":"23049ee5d70a7992","type":"ha-device","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":1,"deviceType":"action","device":"b5da09933af5095776729bbb8ef116ea","event":{"type":"toggle","device_id":"b5da09933af5095776729bbb8ef116ea","entity_id":"light.livingroom_mainlight_gramophone","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[],"x":430,"y":200,"wires":[[]]},{"id":"f66dd231bac152b9","type":"ha-device","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":1,"deviceType":"action","device":"1146c4d46415b1965df40b247e75e3bf","event":{"type":"toggle","device_id":"1146c4d46415b1965df40b247e75e3bf","entity_id":"light.livingroom_mainlight_library","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[],"x":430,"y":260,"wires":[[]]},{"id":"c77a5b62ecc09046","type":"ha-device","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":1,"deviceType":"action","device":"c89bf0613661789cc7e714323b4844a7","event":{"type":"toggle","device_id":"c89bf0613661789cc7e714323b4844a7","entity_id":"light.livingroom_mainlight_fireplace","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[],"x":430,"y":320,"wires":[[]]}] \ No newline at end of file +[{"id":"af32a28ba9e46f29","type":"tab","label":"Living room - Main light","disabled":false,"info":"Obývák - hlavní světla\r\n\r\n4x RGB žárovka\r\n1x scene switch\r\n\r\n1-click: toggle\r\n2-click:\r\npush:","env":[]},{"id":"8850e193.e1712","type":"subflow","name":"SaveChart","info":"","category":"","in":[{"x":80,"y":140,"wires":[{"id":"40784bb1.204934"}]}],"out":[{"x":820,"y":120,"wires":[{"id":"a6525d2.cb354a","port":0}]}]},{"id":"e58cc30d.0bb9","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"a07f98a5c7ec3274","type":"mqtt-broker","name":"mosquitto","broker":"core-mosquitto","port":"1883","clientid":"nodered","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"a0f72417.ea2838","type":"file","z":"8850e193.e1712","name":"backup","filename":"","appendNewline":false,"createDir":true,"overwriteFile":"true","x":700,"y":160,"wires":[[]]},{"id":"70a2db09.6ff354","type":"file in","z":"8850e193.e1712","name":"restore","filename":"","format":"utf8","sendError":true,"x":530,"y":120,"wires":[["a6525d2.cb354a"]]},{"id":"922d4285.5f7e1","type":"json","z":"8850e193.e1712","name":"","property":"payload","action":"str","pretty":false,"x":530,"y":160,"wires":[["a0f72417.ea2838"]]},{"id":"a6525d2.cb354a","type":"json","z":"8850e193.e1712","name":"","property":"payload","action":"str","pretty":false,"x":690,"y":120,"wires":[[]]},{"id":"40784bb1.204934","type":"function","z":"8850e193.e1712","name":"LoadSave","func":"var strSafe=msg.topic;\nif(strSafe)\n{\n msg.filename =\"/share/chart.save\";\n var loaded=context.get(strSafe)||0;\n \n if(0===loaded||strSafe==\"restore\")\n {\n //node.warn(\"Loading chart\");\n msg.payload=\"load\";\n context.set(strSafe,1);\n }\n else\n {\n //node.warn(\"Writing chart\");\n //node.warn(msg.payload);\n }\n return msg;\n \n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":230,"y":140,"wires":[["51fb3038.7afb6"]]},{"id":"51fb3038.7afb6","type":"switch","z":"8850e193.e1712","name":"Load data","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"load","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":380,"y":140,"wires":[["70a2db09.6ff354"],["922d4285.5f7e1"]]},{"id":"dbe202dbcec1134a","type":"mqtt in","z":"af32a28ba9e46f29","name":"","topic":"zigbee2mqtt/livingroom_scene_switch","qos":"1","datatype":"json","broker":"a07f98a5c7ec3274","nl":false,"rap":true,"rh":0,"inputs":0,"x":190,"y":60,"wires":[["e73dbc5cf9e4c229","b97b7b166ff889f4"]]},{"id":"e73dbc5cf9e4c229","type":"switch","z":"af32a28ba9e46f29","name":"","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"1_single","vt":"str"},{"t":"eq","v":"2_single","vt":"str"},{"t":"eq","v":"3_single","vt":"str"},{"t":"eq","v":"4_single","vt":"str"},{"t":"eq","v":"1_double","vt":"str"},{"t":"eq","v":"2_double","vt":"str"},{"t":"eq","v":"3_double","vt":"str"},{"t":"eq","v":"4_double","vt":"str"},{"t":"eq","v":"1_hold","vt":"str"},{"t":"eq","v":"2_hold","vt":"str"},{"t":"eq","v":"3_hold","vt":"str"},{"t":"eq","v":"4_hold","vt":"str"}],"checkall":"true","repair":false,"outputs":12,"x":150,"y":400,"wires":[["4fac346c3d066f8f"],["23049ee5d70a7992"],["f66dd231bac152b9"],["c77a5b62ecc09046"],[],[],[],[],[],[],[],[]]},{"id":"5ac058fedde86732","type":"mqtt out","z":"af32a28ba9e46f29","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"a07f98a5c7ec3274","x":1310,"y":140,"wires":[]},{"id":"4860bb0911a4b518","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"zigbee2mqtt/livingroom/main_light_2/set\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":380,"wires":[["19f51c0d8c733dec"]]},{"id":"ebef887b98106c6c","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"zigbee2mqtt/livingroom/main_light_1/set\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":460,"wires":[["77db2ac50a130285"]]},{"id":"77db2ac50a130285","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness\":254,\"color_temp\":463,\"state\":\"ON\"}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":260,"wires":[[]]},{"id":"b5c290e4d668cca3","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"zigbee2mqtt/livingroom/main_light_3/set\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":420,"wires":[[]]},{"id":"166f158e7450c9fc","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"\"zigbee2mqtt/livingroom/main_light_4/set\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":460,"wires":[[]]},{"id":"b8926c4a994bfe9a","type":"debug","z":"af32a28ba9e46f29","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1290,"y":360,"wires":[]},{"id":"4fac346c3d066f8f","type":"ha-device","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":1,"deviceType":"action","device":"68bc07dee263ff26a97db77cf19fb386","event":{"type":"toggle","device_id":"68bc07dee263ff26a97db77cf19fb386","entity_id":"light.livingroom_mainlight_aquarium","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[],"x":430,"y":140,"wires":[[]]},{"id":"35b67c9fd149c560","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"brightness\": 254,\t \"color_mode\": \"color_temp\",\t \"color_temp\": 454,\t \"state\": state\t}\t\t\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":200,"wires":[["5ac058fedde86732","b8926c4a994bfe9a"]]},{"id":"0884a251ca1add3e","type":"function","z":"af32a28ba9e46f29","name":"","func":"if(msg.payload.state==\"ON\"){\n msg.payload.state=\"OFF\"\n} else {\n msg.payload.state=\"ON\"\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":560,"wires":[[]]},{"id":"739ce27373dcbdf0","type":"inject","z":"af32a28ba9e46f29","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":520,"wires":[[]]},{"id":"e01925178734cf09","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"state\": \"ON\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":220,"wires":[["35b67c9fd149c560"]]},{"id":"b97b7b166ff889f4","type":"debug","z":"af32a28ba9e46f29","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":60,"wires":[]},{"id":"19f51c0d8c733dec","type":"api-current-state","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":3,"outputs":2,"halt_if":"ON","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.0xb4e3f9fffe102c1f","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":650,"y":380,"wires":[["3c9ea731c2cd44a5"],["e01925178734cf09"]]},{"id":"3c9ea731c2cd44a5","type":"change","z":"af32a28ba9e46f29","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"state\": \"OFF\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":180,"wires":[["35b67c9fd149c560"]]},{"id":"23049ee5d70a7992","type":"ha-device","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":1,"deviceType":"action","device":"b5da09933af5095776729bbb8ef116ea","event":{"type":"toggle","device_id":"b5da09933af5095776729bbb8ef116ea","entity_id":"light.livingroom_mainlight_gramophone","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[],"x":430,"y":200,"wires":[[]]},{"id":"f66dd231bac152b9","type":"ha-device","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":1,"deviceType":"action","device":"1146c4d46415b1965df40b247e75e3bf","event":{"type":"toggle","device_id":"1146c4d46415b1965df40b247e75e3bf","entity_id":"light.livingroom_mainlight_library","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[],"x":430,"y":260,"wires":[[]]},{"id":"c77a5b62ecc09046","type":"ha-device","z":"af32a28ba9e46f29","name":"","server":"e58cc30d.0bb9","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":1,"deviceType":"action","device":"c89bf0613661789cc7e714323b4844a7","event":{"type":"toggle","device_id":"c89bf0613661789cc7e714323b4844a7","entity_id":"light.livingroom_mainlight_fireplace","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[],"x":430,"y":320,"wires":[[]]}] \ No newline at end of file diff --git a/secrets.yaml b/secrets.yaml index ca6c8b7..d822d69 100644 --- a/secrets.yaml +++ b/secrets.yaml @@ -1,8 +1,8 @@ - # Use this file to store secrets like usernames and passwords. # Learn more at https://www.home-assistant.io/docs/configuration/secrets/ some_password: welcome +xiaomi_vacuum_host: 192.168.88.22 xiaomi_vacuum_token: 54553270474f35576e55325450506261 xiaomi_cloud_username: habad@hotmail.cz xiaomi_cloud_password: Maska.MiAccount @@ -15,4 +15,4 @@ influxdb_token: cqMQvcDUlP6_Zo88s_MXsl672zJQaIcAZ6h5ZZANtgr1Hn-Z08pXp8SPxtRcEfHy # Samsung Galaxy Tab3 kiosk_galaxy_url: http://192.168.88.55:2323/?cmd=deviceInfo&type=json&password=ha-kiosk kiosk_galaxy_command: "http://192.168.88.55:2323/?cmd={{ cmd }}&key={{ key }}&value={{ value }}&type=json&password=ha-kiosk" -kiosk_galaxy_settings: "http://192.168.88.55:2323/?cmd=listSettings&type=json&password=ha-kiosk" \ No newline at end of file +kiosk_galaxy_settings: "http://192.168.88.55:2323/?cmd=listSettings&type=json&password=ha-kiosk" diff --git a/template.yaml b/template.yaml index 9baa1b9..9269107 100644 --- a/template.yaml +++ b/template.yaml @@ -31,7 +31,7 @@ device_class: power_factor state_class: measurement -# Klimatizace - aktuální teplota + # Klimatizace - aktuální teplota - name: "AC Livingroom Current temperature" unique_id: ac_livingroom_current_temperature unit_of_measurement: "°C" @@ -56,4 +56,4 @@ unique_id: ac_guestroom_current_temperature unit_of_measurement: "°C" state: > - {{ state_attr('climate.ac_guestroom', 'current_temperature') }} \ No newline at end of file + {{ state_attr('climate.ac_guestroom', 'current_temperature') }} diff --git a/var.yaml b/var.yaml new file mode 100644 index 0000000..3ba788b --- /dev/null +++ b/var.yaml @@ -0,0 +1,10 @@ +color_ac_livingroom: + initial_value: #ff9800 +color_ac_bathroom: + initial_value: #3498db +color_ac_bedroom: + initial_value: #e74c3c +color_ac_childrensroom: + initial_value: #9b59b6 +color_ac_guestroom: + initial_value: #f1c40f diff --git a/zigbee2mqtt/devices.yaml b/zigbee2mqtt/devices.yaml index 2cc4316..42d7701 100644 --- a/zigbee2mqtt/devices.yaml +++ b/zigbee2mqtt/devices.yaml @@ -1,10 +1,10 @@ -'0xb4e3f9fffe102c12': - friendly_name: livingroom/mainlight_gramophone -'0x84fd27fffed7b8a4': - friendly_name: livingroom/mainlight_fireplace -'0x84fd27fffe80415b': - friendly_name: livingroom/mainlight_library -'0xb4e3f9fffe102c1f': - friendly_name: livingroom/mainlight_aquarium -'0x60a423fffefc9539': - friendly_name: livingroom/scene_switch +"0xb4e3f9fffe102c12": + friendly_name: livingroom_mainlight_gramophone +"0x84fd27fffed7b8a4": + friendly_name: livingroom_mainlight_fireplace +"0x84fd27fffe80415b": + friendly_name: livingroom_mainlight_library +"0xb4e3f9fffe102c1f": + friendly_name: livingroom_mainlight_aquarium +"0x60a423fffefc9539": + friendly_name: livingroom_scene_switch