vuko | deeeff8 | 2022-10-02 23:12:29 +0200 | [diff] [blame] | 1 | { |
| 2 | default_config = {}; |
| 3 | |
| 4 | homeassistant = { |
| 5 | auth_providers = [ |
| 6 | { |
| 7 | type = "homeassistant"; |
| 8 | } |
| 9 | { |
| 10 | type = "trusted_networks"; |
| 11 | trusted_networks = ["127.0.0.1" "::1" "10.0.0.0/8" "fd00::/8"]; |
| 12 | allow_bypass_login = true; |
| 13 | } |
| 14 | ]; |
| 15 | customize = { |
| 16 | "light.left_par_brightness" = {hidden = true;}; |
| 17 | "light.right_par_brightness" = {hidden = true;}; |
| 18 | "switch.portable_spejsiot_node_b4a90f" = {icon = "mdi:power-plug";}; |
| 19 | "switch.projection_screen" = {icon = "mdi:projector-screen";}; |
| 20 | "switch.projector" = {icon = "mdi:projector";}; |
| 21 | "switch.samsung_tv_mute" = {icon = "mdi:volume-off";}; |
| 22 | "switch.samsung_tv_telelele" = {icon = "mdi:monitor";}; |
| 23 | "switch.space_heater" = {icon = "mdi:fire";}; |
| 24 | }; |
| 25 | customize_glob = {"media_player.m*" = {custom_ui_state_card = "state-card-mini-media-player";};}; |
| 26 | elevation = "106"; |
| 27 | latitude = "52.25"; |
| 28 | longitude = "21"; |
| 29 | name = "Warsaw Hackerspace"; |
| 30 | time_zone = "Europe/Warsaw"; |
| 31 | unit_system = "metric"; |
| 32 | }; |
| 33 | |
| 34 | http = { |
| 35 | use_x_forwarded_for = true; |
| 36 | trusted_proxies = [ "127.0.0.1" "::1" ]; |
| 37 | }; |
| 38 | |
| 39 | automation = [ |
| 40 | { |
| 41 | action = { |
| 42 | data_template = { |
| 43 | payload = "{{ states('input_number.polycom_hdmi_gain') }}"; |
| 44 | retain = true; |
| 45 | topic = "iot/polycom/hdmi:main/gain/set"; |
| 46 | }; |
| 47 | service = "mqtt.publish"; |
| 48 | }; |
| 49 | hide_entity = true; |
| 50 | trigger = { |
| 51 | entity_id = "input_number.polycom_hdmi_gain"; |
| 52 | platform = "state"; |
| 53 | }; |
| 54 | } |
| 55 | { |
| 56 | action = { |
| 57 | data_template = { |
| 58 | payload = "{{ states('input_number.polycom_aux1_gain') }}"; |
| 59 | retain = true; |
| 60 | topic = "iot/polycom/aux1:main/gain/set"; |
| 61 | }; |
| 62 | service = "mqtt.publish"; |
| 63 | }; |
| 64 | hide_entity = true; |
| 65 | trigger = { |
| 66 | entity_id = "input_number.polycom_aux1_gain"; |
| 67 | platform = "state"; |
| 68 | }; |
| 69 | } |
| 70 | { |
| 71 | action = { |
| 72 | data_template = { |
| 73 | payload = "{{ states.input_select.hdmi_source_a.attributes['options'].index(states('input_select.hdmi_source_a')) }}"; |
| 74 | retain = true; |
| 75 | topic = "iot/3c189c/matrix/sourceA/set"; |
| 76 | }; |
| 77 | service = "mqtt.publish"; |
| 78 | }; |
| 79 | hide_entity = true; |
| 80 | trigger = { |
| 81 | entity_id = "input_select.hdmi_source_a"; |
| 82 | platform = "state"; |
| 83 | }; |
| 84 | } |
| 85 | { |
| 86 | action = { |
| 87 | data_template = { |
| 88 | payload = "{{ states.input_select.hdmi_source_b.attributes['options'].index(states('input_select.hdmi_source_b')) }}"; |
| 89 | retain = true; |
| 90 | topic = "iot/3c189c/matrix/sourceB/set"; |
| 91 | }; |
| 92 | service = "mqtt.publish"; |
| 93 | }; |
| 94 | hide_entity = true; |
| 95 | trigger = { |
| 96 | entity_id = "input_select.hdmi_source_b"; |
| 97 | platform = "state"; |
| 98 | }; |
| 99 | } |
| 100 | { |
| 101 | action = { |
| 102 | data = { |
| 103 | entity_id = "input_select.hdmi_source_b"; |
| 104 | option = "Input 1 / Kolumna"; |
| 105 | }; |
| 106 | service = "input_select.select_option"; |
| 107 | }; |
| 108 | alias = "Switch projector on HDMI1 connect"; |
| 109 | trigger = { |
| 110 | payload = "true"; |
| 111 | platform = "mqtt"; |
| 112 | topic = "iot/3c189c/matrix/rx1_online"; |
| 113 | }; |
| 114 | } |
| 115 | { |
| 116 | action = { |
| 117 | data = { |
| 118 | entity_id = "input_select.hdmi_source_b"; |
| 119 | option = "Chromecast"; |
| 120 | }; |
| 121 | service = "input_select.select_option"; |
| 122 | }; |
| 123 | alias = "Switch projector on HDMI1 disconnect"; |
| 124 | trigger = { |
| 125 | payload = "false"; |
| 126 | platform = "mqtt"; |
| 127 | topic = "iot/3c189c/matrix/rx1_online"; |
| 128 | }; |
| 129 | } |
| 130 | { |
| 131 | action = { |
| 132 | data_template = { |
| 133 | payload = "{{ states('input_number.heater_fan_speed') }}"; |
| 134 | retain = true; |
| 135 | topic = "iot/ab20d2/heater/fan/set"; |
| 136 | }; |
| 137 | service = "mqtt.publish"; |
| 138 | }; |
| 139 | hide_entity = true; |
| 140 | trigger = { |
| 141 | entity_id = "input_number.heater_fan_speed"; |
| 142 | platform = "state"; |
| 143 | }; |
| 144 | } |
| 145 | ]; |
| 146 | |
| 147 | cast = {media_player = [{host = "10.8.1.44";}];}; |
| 148 | |
| 149 | # TODO fix and enable |
| 150 | #frontend = { |
| 151 | # extra_html_url = ["/local/custom_ui/state-card-mini-media-player.html"]; |
| 152 | # extra_html_url_es5 = ["/local/custom_ui/state-card-mini-media-player_es5.html"]; |
| 153 | #}; |
| 154 | |
| 155 | group = { |
| 156 | av = { |
| 157 | control = "hidden"; |
| 158 | entities = ["switch.projector" "switch.projection_screen" "input_select.hdmi_source_a" "input_number.polycom_hdmi_gain" "switch.samsung_tv_telelele" "switch.samsung_tv_mute" "input_select.hdmi_source_b" "input_number.polycom_aux1_gain" "switch.aux1_gain_mic" "media_player.mpd"]; |
| 159 | name = "HackAV"; |
| 160 | }; |
| 161 | heater = { |
| 162 | control = "hidden"; |
| 163 | entities = ["switch.space_heater" "input_number.heater_fan_speed"]; |
| 164 | name = "Heater"; |
| 165 | }; |
| 166 | }; |
| 167 | input_number = { |
| 168 | heater_fan_speed = { |
| 169 | max = 100; |
| 170 | min = 0; |
| 171 | name = "Fan Speed"; |
| 172 | step = 1; |
| 173 | }; |
| 174 | polycom_aux1_gain = { |
| 175 | max = 10; |
| 176 | min = -40; |
| 177 | name = "AUX1 Audio Gain"; |
| 178 | step = 1; |
| 179 | }; |
| 180 | polycom_hdmi_gain = { |
| 181 | max = 0; |
| 182 | min = -40; |
| 183 | name = "HDMI Audio Gain"; |
| 184 | step = 1; |
| 185 | }; |
| 186 | }; |
| 187 | input_select = { |
| 188 | hdmi_source_b = { |
| 189 | name = "Projector HDMI Source (Conn A/TX1)"; |
| 190 | options = ["PS3" "Input 1 / Kolumna" "Unused" "Chromecast"]; |
| 191 | }; |
| 192 | }; |
| 193 | |
| 194 | media_player = [ |
| 195 | { |
| 196 | host = "10.8.1.16"; |
| 197 | platform = "mpd"; |
| 198 | } |
| 199 | ]; |
| 200 | |
| 201 | mqtt = { |
| 202 | light = [ |
| 203 | { |
| 204 | command_topic = "iot/077521/relay/on/set"; |
| 205 | name = "Main room"; |
| 206 | payload_off = "false"; |
| 207 | payload_on = "true"; |
| 208 | retain = true; |
| 209 | state_topic = "iot/077521/relay/on"; |
| 210 | } |
| 211 | ]; |
| 212 | fan = [ |
| 213 | { |
| 214 | command_topic = "iot/c0dbe7/relay/on/set"; |
| 215 | name = "Wyciąg"; |
| 216 | payload_off = "false"; |
| 217 | payload_on = "true"; |
| 218 | retain = true; |
| 219 | state_topic = "iot/c0dbe7/relay/on"; |
| 220 | } |
| 221 | ]; |
| 222 | sensor = [ |
| 223 | { |
| 224 | name = "DCR01 Temperature"; |
| 225 | qos = 0; |
| 226 | state_topic = "iot/3394f5/environment/degree"; |
| 227 | unit_of_measurement = "ºC"; |
| 228 | } |
| 229 | { |
| 230 | name = "DCR01 Humidity"; |
| 231 | qos = 0; |
| 232 | state_topic = "iot/3394f5/environment/humidity"; |
| 233 | unit_of_measurement = "%"; |
| 234 | } |
| 235 | ]; |
| 236 | switch = [ |
| 237 | { |
| 238 | command_topic = "iot/b4a90f/relay/on/set"; |
| 239 | name = "Portable SpejsIoT node (b4a90f)"; |
| 240 | payload_off = "false"; |
| 241 | payload_on = "true"; |
| 242 | retain = true; |
| 243 | state_topic = "iot/b4a90f/relay/on"; |
| 244 | } |
| 245 | { |
| 246 | command_topic = "iot/d106e1/screen/down/set"; |
| 247 | name = "Projection screen"; |
| 248 | payload_off = "false"; |
| 249 | payload_on = "true"; |
| 250 | retain = true; |
| 251 | state_topic = "iot/d106e1/screen/down"; |
| 252 | } |
| 253 | { |
| 254 | command_topic = "iot/craptrap/windows10/state/set"; |
| 255 | name = "Windows 10 VM (Craptrap)"; |
| 256 | payload_off = "pmsuspended"; |
| 257 | payload_on = "running"; |
| 258 | state_topic = "iot/craptrap/windows10/state"; |
| 259 | } |
| 260 | { |
| 261 | command_topic = "iot/ab20d2/heater/on/set"; |
| 262 | name = "Space Heater"; |
| 263 | payload_off = "false"; |
| 264 | payload_on = "true"; |
| 265 | retain = true; |
| 266 | state_topic = "iot/ab20d2/heater/on"; |
| 267 | } |
| 268 | ]; |
| 269 | }; |
| 270 | |
| 271 | scene = [ |
| 272 | { |
| 273 | entities = { |
| 274 | "light.main_room" = false; |
| 275 | "switch.projection_screen" = true; |
| 276 | "switch.projector" = true; |
| 277 | }; |
| 278 | name = "Cinema"; |
| 279 | } |
| 280 | { |
| 281 | entities = { |
| 282 | "light.main_room" = true; |
| 283 | "switch.projection_screen" = false; |
| 284 | "switch.projector" = false; |
| 285 | }; |
| 286 | name = "Standard"; |
| 287 | } |
| 288 | ]; |
| 289 | } |