diff --git a/automations.yaml b/automations.yaml new file mode 100644 index 0000000..b13b9fb --- /dev/null +++ b/automations.yaml @@ -0,0 +1,127 @@ +- id: grill_ready + alias: Grill temperature reached + trigger: + - platform: state + entity_id: sensor.target_alert_temp_probe_1 + from: Cooking + to: Ready + for: + hours: 0 + minutes: 0 + seconds: 10 + milliseconds: 0 + action: + - service: media_player.volume_set + data: + volume_level: 0.5 + target: + entity_id: media_player.dining_room + - service: tts.google_translate_say + data: + entity_id: media_player.dining_room + language: da + message: Maden har nået sin temperatur. + - delay: + hours: 0 + minutes: 0 + seconds: 10 + milliseconds: 0 + mode: single +- id: '1638599831163' + alias: Sluk/Tænd hele huset + description: '' + trigger: + - platform: device + device_id: 3b2ded9a95c3fe134f3efd894664f376 + domain: homekit_controller + type: button1 + subtype: single_press + condition: [] + action: + - choose: + - conditions: + - condition: state + entity_id: input_boolean.lights_state + state: 'on' + sequence: + - service: homeassistant.turn_off + target: + entity_id: light.all_lights_off + - service: tts.google_translate_say + data: + entity_id: media_player.dining_room + message: Slukker, farvel. + language: da + - conditions: + - condition: state + entity_id: input_boolean.lights_state + state: 'off' + sequence: + - service: homeassistant.turn_on + target: + entity_id: light.all_lights_on + - service: tts.google_translate_say + data: + message: Tænder, velkommen hjem. + language: da + entity_id: media_player.dining_room + default: [] + - service: input_boolean.toggle + target: + entity_id: input_boolean.lights_state + mode: single +- id: '1641736922094' + alias: TV Bænk On/Off + description: '' + trigger: + - platform: device + device_id: 6b635bb1a0fe1c969189555f17b08607 + domain: homekit_controller + type: button1 + subtype: single_press + condition: [] + action: + - type: toggle + device_id: 73bc53e7aa7d51d9a102dbb47a7da634 + entity_id: switch.tv_baenk + domain: switch + mode: single +- id: '1661628189392' + alias: TAG - Husavik + description: '' + use_blueprint: + path: tags/spotify.yaml + input: + tag_id: 4B-F8-7D-02 + url: https://open.spotify.com/track/6ofMKJjMpfDEb48JYEAgjX +- id: '1661665908214' + alias: TAG - Se Bubba + description: '' + use_blueprint: + path: tags/androidtv.yaml + input: + show_id: '81396994' + tag_id: A5-CE-BA-AD +- id: '1661668123790' + alias: TAG - Se Gurli Gris + description: '' + use_blueprint: + path: tags/androidtv.yaml + input: + show_id: '80025590' +- id: '1661785691824' + alias: TAG - Rick Roll + description: '' + use_blueprint: + path: tags/spotify.yaml + input: + url: https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT + tag_id: EB-36-0B-03 +- id: '1661785727144' + alias: TAG - Rollespil + description: '' + use_blueprint: + path: tags/spotify.yaml + input: + url: https://open.spotify.com/track/4llJfGpDZXud9PVCSUJflU + tag_id: 45-A9-47-E3 diff --git a/blueprints/automation/homeassistant/motion_light.yaml b/blueprints/automation/homeassistant/motion_light.yaml new file mode 100644 index 0000000..c11d22d --- /dev/null +++ b/blueprints/automation/homeassistant/motion_light.yaml @@ -0,0 +1,50 @@ +blueprint: + name: Motion-activated Light + description: Turn on a light when motion is detected. + domain: automation + source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml + input: + motion_entity: + name: Motion Sensor + selector: + entity: + domain: binary_sensor + device_class: motion + light_target: + name: Light + selector: + target: + entity: + domain: light + no_motion_wait: + name: Wait time + description: Time to leave the light on after last motion is detected. + default: 120 + selector: + number: + min: 0 + max: 3600 + unit_of_measurement: seconds + +# If motion is detected within the delay, +# we restart the script. +mode: restart +max_exceeded: silent + +trigger: + platform: state + entity_id: !input motion_entity + from: "off" + to: "on" + +action: + - service: light.turn_on + target: !input light_target + - wait_for_trigger: + platform: state + entity_id: !input motion_entity + from: "on" + to: "off" + - delay: !input no_motion_wait + - service: light.turn_off + target: !input light_target diff --git a/blueprints/automation/homeassistant/notify_leaving_zone.yaml b/blueprints/automation/homeassistant/notify_leaving_zone.yaml new file mode 100644 index 0000000..d3a70d7 --- /dev/null +++ b/blueprints/automation/homeassistant/notify_leaving_zone.yaml @@ -0,0 +1,43 @@ +blueprint: + name: Zone Notification + description: Send a notification to a device when a person leaves a specific zone. + domain: automation + source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml + input: + person_entity: + name: Person + selector: + entity: + domain: person + zone_entity: + name: Zone + selector: + entity: + domain: zone + notify_device: + name: Device to notify + description: Device needs to run the official Home Assistant app to receive notifications. + selector: + device: + integration: mobile_app + +trigger: + platform: state + entity_id: !input person_entity + +variables: + zone_entity: !input zone_entity + # This is the state of the person when it's in this zone. + zone_state: "{{ states[zone_entity].name }}" + person_entity: !input person_entity + person_name: "{{ states[person_entity].name }}" + +condition: + condition: template + value_template: "{{ trigger.from_state.state == zone_state and trigger.to_state.state != zone_state }}" + +action: + domain: mobile_app + type: notify + device_id: !input notify_device + message: "{{ person_name }} has left {{ zone_state }}" diff --git a/blueprints/automation/tags/androidtv.yaml b/blueprints/automation/tags/androidtv.yaml new file mode 100644 index 0000000..0ff4f28 --- /dev/null +++ b/blueprints/automation/tags/androidtv.yaml @@ -0,0 +1,32 @@ +blueprint: + name: TAG - Netflix + description: Play a movie/show on netflix, when a tag is scanned + domain: automation + input: + tag_id: + name: Tag + description: The id of the tag + default: "" + show_id: + name: Show + description: The id of the show to play on netflix. + default: "" + +trigger: + - platform: tag + tag_id: !input tag_id + +condition: [] + +variables: + show_id: !input show_id + +action: + - service: androidtv.adb_command + data: + command: >- + am start -n com.netflix.ninja/.MainActivity -a android.intent.action.VIEW -d http://www.netflix.com/watch/{{ show_id }} -e source 30 && input 23 && input 23 + target: + entity_id: media_player.android_tv_10_0_1_252 + +mode: single diff --git a/blueprints/automation/tags/spotify.yaml b/blueprints/automation/tags/spotify.yaml new file mode 100644 index 0000000..f3a86c2 --- /dev/null +++ b/blueprints/automation/tags/spotify.yaml @@ -0,0 +1,30 @@ +blueprint: + name: TAG - Spotify + description: Play music on spotify when a tag is scanned + domain: automation + input: + tag_id: + name: Tag + description: The id of the tag + default: "" + url: + name: URL + description: The spotify url for the media to play + default: "" + content_type: + name: Content Type + description: The type of media to play. album/playlist/track + default: "track" + +trigger: + - platform: tag + tag_id: !input tag_id +condition: [] +action: + - service: media_player.play_media + data: + media_content_id: !input url + media_content_type: !input content_type + target: + entity_id: media_player.dining_room +mode: single diff --git a/blueprints/script/homeassistant/confirmable_notification.yaml b/blueprints/script/homeassistant/confirmable_notification.yaml new file mode 100644 index 0000000..ae170ea --- /dev/null +++ b/blueprints/script/homeassistant/confirmable_notification.yaml @@ -0,0 +1,74 @@ +blueprint: + name: Confirmable Notification + description: >- + A script that sends an actionable notification with a confirmation before + running the specified action. + domain: script + source_url: https://github.com/home-assistant/core/blob/master/homeassistant/components/script/blueprints/confirmable_notification.yaml + input: + notify_device: + name: Device to notify + description: Device needs to run the official Home Assistant app to receive notifications. + selector: + device: + integration: mobile_app + title: + name: "Title" + description: "The title of the button shown in the notification." + default: "" + selector: + text: + message: + name: "Message" + description: "The message body" + selector: + text: + confirm_text: + name: "Confirmation Text" + description: "Text to show on the confirmation button" + default: "Confirm" + selector: + text: + confirm_action: + name: "Confirmation Action" + description: "Action to run when notification is confirmed" + default: [] + selector: + action: + dismiss_text: + name: "Dismiss Text" + description: "Text to show on the dismiss button" + default: "Dismiss" + selector: + text: + dismiss_action: + name: "Dismiss Action" + description: "Action to run when notification is dismissed" + default: [] + selector: + action: + +mode: restart + +sequence: + - alias: "Send notification" + domain: mobile_app + type: notify + device_id: !input notify_device + title: !input title + message: !input message + data: + actions: + - action: "CONFIRM" + title: !input confirm_text + - action: "DISMISS" + title: !input dismiss_text + - alias: "Awaiting response" + wait_for_trigger: + - platform: event + event_type: mobile_app_notification_action + - choose: + - conditions: "{{ wait.trigger.event.data.action == 'CONFIRM' }}" + sequence: !input confirm_action + - conditions: "{{ wait.trigger.event.data.action == 'DISMISS' }}" + sequence: !input dismiss_action diff --git a/configuration.yaml b/configuration.yaml new file mode 100644 index 0000000..701c38c --- /dev/null +++ b/configuration.yaml @@ -0,0 +1,174 @@ + +# Configure a default setup of Home Assistant (frontend, api, etc) +default_config: + +group: !include groups.yaml +automation ui: !include automations.yaml +automation manual: !include-dir-list automations/ +script ui: !include scripts.yaml +scene: !include scenes.yaml +light: !include lights.yaml + +http: + use_x_forwarded_for: true + trusted_proxies: + - 10.0.1.98 + +logger: + default: info + logs: + custom_components.hacs: debug + hacs: debug + queueman: debug + AIOGitHubAPI: debug + +recorder: + exclude: + domains: + - group + - history_graph + - media_player + - zone + - automation + - script + - light + - camera + +history: + exclude: + domains: + - group + - history_graph + - media_player + - zone + - automation + - script + - light + - camera + +logbook: + exclude: + domains: + - group + - history_graph + - media_player + - zone + - automation + - script + - light + - camera + +frontend: + themes: !include themes.yaml + extra_module_url: + - /hacsfiles/lovelace-card-mod/card-mod.js + +tts: + - platform: google_translate + base_url: http://10.0.1.101:8123 + +spotcast: + sp_dc: AQAhATYuWsLXQExlnAd9DxuJ7UJz2HTvnouTZ-8Ex__iRAnT2De697spQesUj0cC3BpAu_VEXloXyg3XP9WFyc-kyLylmqD4_GnaFBHaI2aNhw + sp_key: 009ec0de-b75e-4c62-aaad-c2a67074e1bb + country: DK + +camera: + - platform: xiaomi_cloud_map_extractor + host: 10.0.1.103 + token: 42464e4350587248734d6c7a66697742 + username: rolf@fambagge.dk + password: J-zyGAaVGdh-UZlC + country: de + draw: ['all'] + scan_interval: 10 + colors: + color_map_outside: [19, 87, 148] + color_grey_wall: [19, 87, 148] + room_colors: + #Outside rooms:26,1,19 + 1: [19, 87, 148] + 19: [19, 87, 148] + 26: [19, 87, 148] + #Room numbers: 18,23,22,20,16,24,25,21,17 + 18: [240, 178, 122] + 23: [133, 193, 233] + 22: [217, 136, 128] + 20: [52, 152, 219] + 16: [205, 97, 85] + 24: [243, 156, 18] + 25: [88, 214, 141] + 21: [245, 176, 65] + 17: [252, 212, 81] + map_transformation: + trim: + top: 20 + bottom: 22 + left: 15 + right: 17 + attributes: + - calibration_points + - vacuum_position + +influxdb: + host: a0d7b954-influxdb + port: 8086 + database: homeassistant + username: homeassistant + password: homeassistant + max_retries: 3 + default_measurement: state + +mqtt: + sensor: + - state_topic: "bbq/grill/grill/probe1" + name: "iGrill_Temperature" + qos: 0 + unit_of_measurement: "°C" + + - state_topic: "bbq/grill/grill/battery" + name: "iGrill_Battery" + qos: 0 + unit_of_measurement: '%' + device_class: battery + + - state_topic: "stecamonitor/solcelle" + name: "Solcelle produktion" + unique_id: solar_production + unit_of_measurement: "W" + value_template: "{{ value_json.watt }}" + device_class: power + state_class: measurement + +fuelprices_dk: + fueltypes: + - oktan 95 + +sensor: !include-dir-merge-list sensors/ + +template: !include-dir-merge-list template/ + +input_number: + grill_probe_1_target: + name: iGrill Target Temp + initial: 54 + min: 0 + max: 120 + step: 1 + +input_boolean: + lights_state: + name: Wether lights have been turned off + +utility_meter: + util_water_usage_hourly: + source: sensor.water_total + cycle: hourly + util_water_usage_daily: + source: sensor.water_total + cycle: daily + util_water_usage_monthly: + source: sensor.water_total + cycle: monthly + util_water_usage_yearly: + source: sensor.water_total + cycle: yearly \ No newline at end of file diff --git a/esphome/nilan300.yaml b/esphome/nilan300.yaml new file mode 100644 index 0000000..300722d --- /dev/null +++ b/esphome/nilan300.yaml @@ -0,0 +1,601 @@ +esphome: + name: nilan300 + +esp32: + board: nodemcu-32s + framework: + type: arduino + +# Enable logging +logger: + baud_rate: 0 + +# Enable Home Assistant API +api: + +ota: + password: "9939debfff235f69eb37720d836f209c" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +captive_portal: + +uart: + rx_pin: GPIO16 + tx_pin: GPIO17 + parity: EVEN + baud_rate: 19200 + id: uart_modbus + stop_bits: 1 + +modbus: + id: modbus_id + uart_id: uart_modbus + +modbus_controller: + id: nilan_modbus_controller + address: 30 + modbus_id: modbus_id + update_interval: 30s + +external_components: + - source: github://Jopand/esphome_components@main + refresh: 0s + +nilan: + +select: + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Set operation mode" + id: nilan_set_operation_mode + address: 1002 + force_new_range: true + use_write_multiple: true + value_type: U_WORD + optionsmap: + "Off" : 0 + "Heat" : 1 + "Cool" : 2 + "Auto" : 3 + +binary_sensor: + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Summer mode" + id: nilan_is_summer + register_type: read + address: 1200 + bitmask: 1 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Air filter alarm" + id: nilan_filter_alarm + register_type: read + address: 101 + bitmask: 1 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Bypass IsOpen" + id: nilan_bypass_isopen + register_type: read + address: 3000 + bitmask: 1 + +sensor: + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Bus version" + id: nilan_bus_version + internal: true + accuracy_decimals: 0 + entity_category: diagnostic + register_type: read + address: 0 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Inlet (before heater) temperature" + id: nilan_inlet_temp_t2 + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + value_type: S_WORD + register_type: read + address: 202 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Exhaust temperature" + id: nilan_exhaust_temp_t3 + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + value_type: S_WORD + register_type: read + address: 203 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Outlet temperature" + id: nilan_outlet_temp_t4 + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + value_type: S_WORD + register_type: read + address: 204 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Inlet (after heater) temperature" + id: nilan_inlet_temp_t7 + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + register_type: read + address: 207 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Outdoor temperature" + id: nilan_outdoor_temp_t8 + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + value_type: S_WORD + register_type: read + address: 208 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Humidity" + id: nilan_humidity + unit_of_measurement: '%' + accuracy_decimals: 1 + device_class: humidity + register_type: read + address: 221 + filters: + - multiply: 0.01 + on_value: + - lambda: !lambda |- + id(aqi_humidity).publish_state( (x < 35) ? "Too Dry" : + (x < 65) ? "Perfect" : + "Too Humid"); + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Exhaust fan speed" + id: nilan_exhaust_fan_speed + unit_of_measurement: '%' + icon: "mdi:percent" + accuracy_decimals: 0 + register_type: holding + address: 200 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Inlet fan speed" + id: nilan_inlet_fan_speed + unit_of_measurement: '%' + icon: "mdi:percent" + accuracy_decimals: 0 + register_type: holding + address: 201 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Controller temperature" + id: nilan_controller_temp_t0 + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + register_type: read + address: 200 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Room temperature" + id: nilan_room_temp_t15 + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + value_type: S_WORD + register_type: read + address: 215 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Active alarms" + id: nilan_active_alarms + accuracy_decimals: 0 + register_type: read + address: 400 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Actual on/off state" + id: nilan_actual_on_off_state + accuracy_decimals: 0 + register_type: read + address: 1000 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "AirFlow.VentSet" + id: nilan_airflow_vent_set + accuracy_decimals: 0 + register_type: read + address: 1100 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "AirFlow.InletAct" + id: nilan_airflow_inlet_act + accuracy_decimals: 0 + register_type: read + address: 1101 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "AirFlow.ExhaustAct" + id: nilan_airflow_exhaust_act + accuracy_decimals: 0 + register_type: read + address: 1102 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Days since last air filter change alarm" + id: nilan_days_since_last_air_filter_alarm + accuracy_decimals: 0 + register_type: read + address: 1103 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Days to next air filter change alarm" + id: nilan_days_to_next_air_filter_alarm + accuracy_decimals: 0 + register_type: read + address: 1104 + + - platform: template + name: "Calculated difference exhaust and inlet" + id: calculated_value_inlet_exhaust + icon: "mdi:thermometer" + unit_of_measurement: °C + update_interval: 10s + lambda: 'return id(nilan_exhaust_temp_t3).state - id(nilan_inlet_temp_t7).state;' + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Heat exchange efficiency" + id: nilan_heat_exchange_efficiency + unit_of_measurement: '%' + accuracy_decimals: 1 + register_type: read + address: 1204 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Cooling set temperature" + id: nilan_cooling_set_temp + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + register_type: holding + address: 1200 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Min summer temperature" + id: nilan_min_summer_temp + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + register_type: holding + address: 1201 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Min winter temperature" + id: nilan_min_winter_temp + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + register_type: holding + address: 1202 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Max summer temperature" + id: nilan_max_summer_temp + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + register_type: holding + address: 1203 + filters: + - multiply: 0.01 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Max winter temperature" + id: nilan_max_winter_temp + unit_of_measurement: °C + accuracy_decimals: 1 + device_class: temperature + register_type: holding + address: 1204 + filters: + - multiply: 0.01 + +number: + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Ventilation speed set" + id: nilan_ventilation_speed_set + min_value: 0 + max_value: 4 + step: 1.0 + address: 1003 + force_new_range: true + use_write_multiple: true + + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Temperature set" + id: nilan_target_temperature_set + min_value: 12 + max_value: 30 + step: 1.0 + address: 1004 + force_new_range: true + use_write_multiple: true + multiply: 100 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Humidity low vent step" + id: humidity_low_vent_step + min_value: 0.0 + max_value: 4.0 + step: 1.0 + address: 1910 + force_new_range: true + use_write_multiple: true + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Humidity high vent step" + id: humidity_high_vent_step + min_value: 0.0 + max_value: 4.0 + step: 1.0 + address: 1911 + force_new_range: true + use_write_multiple: true + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Humidity limit low vent" + id: humidity_limit_low_vent + unit_of_measurement: '%' + icon: "mdi:percent" + min_value: 15.0 + max_value: 45.0 + step: 1.0 + address: 1912 + force_new_range: true + use_write_multiple: true + multiply: 100 + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Humidity max time on high ventilation (minutes)" + id: humidity_max_time_high_vent + value_type: U_WORD + unit_of_measurement: minutes + min_value: 0.0 + max_value: 180.0 + step: 1.0 + address: 1913 + force_new_range: true + use_write_multiple: true + icon: mdi:clock-start + +text_sensor: + - platform: template + name: "Air Quality Index Humidity (AQI)" + id: aqi_humidity + icon: mdi:water-percent + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Operation mode" + id: nilan_operation_mode + register_type: read + address: 1001 + lambda: !lambda |- + uint16_t int_mode = (data[item->offset] << 8) + data[item->offset+1]; + ESP_LOGD("main","Parsed operation mode int : %d", int_mode); + std::string mode_str; + switch (int_mode) { + case 0: mode_str = "Off"; break; + case 1: mode_str = "Heat"; break; + case 2: mode_str = "Cool"; break; + case 3: mode_str = "Auto"; break; + case 4: mode_str = "Service"; break; + default: mode_str = "Unknown"; break; + } + return mode_str; + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Control mode" + id: nilan_control_state + register_type: read + address: 1002 + lambda: !lambda |- + uint16_t int_mode = (data[item->offset] << 8) + data[item->offset+1]; + ESP_LOGD("main","Parsed operation mode int : %d", int_mode); + std::string mode_str; + switch (int_mode) { + case 0: mode_str = "Off"; break; + case 1: mode_str = "Shift"; break; + case 2: mode_str = "Stop"; break; + case 3: mode_str = "Start"; break; + case 4: mode_str = "Standby"; break; + case 5: mode_str = "Ventilation stop"; break; + case 6: mode_str = "Ventilation"; break; + case 7: mode_str = "Heating"; break; + case 8: mode_str = "Cooling"; break; + case 9: mode_str = "Hot water"; break; + case 10: mode_str = "Legionella"; break; + case 11: mode_str = "Cooling + hot water"; break; + case 12: mode_str = "Central heating"; break; + case 13: mode_str = "Defrost"; break; + case 14: mode_str = "Frost secure"; break; + case 15: mode_str = "Service"; break; + case 16: mode_str = "Alarm"; break; + default: mode_str = "Unknown"; break; + } + return mode_str; + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Software version" + id: nilan_version_info + register_type: read + register_count: 3 + response_size: 6 + address: 1 + entity_category: diagnostic + lambda: !lambda |- + float bus_version = nilan_bus_version->get_state(); + std::string output; + + if (bus_version == 8) { + output = data[item->offset+1]; + output += data[item->offset+0]; + output += data[item->offset+3]; + output += data[item->offset+2]; + output += data[item->offset+5]; + output += data[item->offset+4]; + } else { + output = data[item->offset+0]; + output += data[item->offset+1]; + output += '.'; + output += data[item->offset+2]; + output += data[item->offset+3]; + output += '.'; + output += data[item->offset+4]; + output += data[item->offset+5]; + } + + ESP_LOGD("main","Parsed SW version: %s", output.c_str()); + return output; + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "Aggregate type" + id: nilan_platform_id + entity_category: diagnostic + register_type: holding + address: 1000 + lambda: !lambda |- + uint16_t int_type = (data[item->offset] << 8) + data[item->offset+1]; + ESP_LOGD("main","Parsed aggregate type int : %d", int_type); + std::string type_str; + switch (int_type) { + case 0: type_str = "None"; break; + case 1: type_str = "Test"; break; + case 2: type_str = "VPL 10 uden køl"; break; + case 3: type_str = "VPL 15 uden køl"; break; + case 4: type_str = "VPL 15 med køl"; break; + case 5: type_str = "VPL 25 med 3 hastigheder uden køl"; break; + case 6: type_str = "VPL 25 med 3 hastigheder med køl"; break; + case 7: type_str = "VPL 28 2 hastigheder uden køl"; break; + case 8: type_str = "VPL 28 med 2 hastigheder med køl"; break; + case 9: type_str = "VP 18 med kryds monteret oven på anlæg uden køl"; break; + case 10: type_str = "VP 18 med kryds monteret oven på anlæg med køl"; break; + case 11: type_str = "Vp 18 Compact og Compact p uden køl"; break; + case 12: type_str = "VP 18 Compact og Compact P med køl"; break; + case 13: type_str = "Comfort anlæg (Comfort 300 LR)"; break; + case 14: type_str = "CT 150 anlæg med 1-2-3 omskifter"; break; + case 15: type_str = "VLX som kører VAV"; break; + case 16: type_str = "VLX med 2 trin"; break; + case 17: type_str = "VLX med 3 trin"; break; + case 18: type_str = "VP 18 uden køl"; break; + case 19: type_str = "VP 18 med køl"; break; + case 20: type_str = "VP 18 med elkedel uden køl"; break; + case 21: type_str = "VP 18 med elkedel og køl"; break; + case 22: type_str = "VGU 250 brugsvands varmepumpe"; break; + case 23: type_str = "VGU 250 brugsvands varmepumpe med elkedel"; break; + case 24: type_str = "VPL 25 uden køl"; break; + case 25: type_str = "VPL 25 med køl"; break; + case 26: type_str = "VPM 120-560"; break; + case 27: type_str = "Comfort 1200 - 4000"; break; + case 28: type_str = "VP 20 Compact gorona"; break; + case 29: type_str = "VLX med CTS 602 print"; break; + case 30: type_str = "Compact P Nordic"; break; + case 31: type_str = "Comfort Nordic"; break; + case 32: type_str = "VP 18 Version 1"; break; + case 33: type_str = "Combi 300"; break; + case 34: type_str = "Compact med 4-vejsventil uden køl"; break; + default: type_str = "Unknown"; break; + } + return type_str; + +switch: + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + name: "On/Off state" + id: nilan_on_off_state + register_type: holding + bitmask: 1 + force_new_range: true + use_write_multiple: true + address: 1001 + +climate: + - platform: nilan + name: Nilan + current_temp_sensor_id: nilan_inlet_temp_t7 + target_temp_sensor_id: nilan_target_temperature_set + fan_speed_sensor_id: nilan_ventilation_speed_set + mode_select_id: nilan_set_operation_mode + diff --git a/esphome/smartcard.yaml b/esphome/smartcard.yaml new file mode 100644 index 0000000..de2d0f9 --- /dev/null +++ b/esphome/smartcard.yaml @@ -0,0 +1,42 @@ +esphome: + name: smartcard + +esp32: + board: nodemcu-32s + framework: + type: arduino + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "kA9qErLxzAH8VQB84Li1WRVvsHdFlOKVNdz6vEtqfyI=" + +ota: + password: "7a876bd40942451be286989b1dece5d7" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Smartcard Fallback Hotspot" + password: "aOZuoLcfq73d" + +captive_portal: + +# Example configuration entry +spi: + clk_pin: GPIO18 + mosi_pin: GPIO23 + miso_pin: GPIO19 + +rc522_spi: + cs_pin: GPIO5 + + on_tag: + then: + - homeassistant.tag_scanned: !lambda 'return x;' \ No newline at end of file diff --git a/esphome/waterproxy.yaml b/esphome/waterproxy.yaml new file mode 100644 index 0000000..1358b1f --- /dev/null +++ b/esphome/waterproxy.yaml @@ -0,0 +1,35 @@ +esphome: + name: waterproxy + +esp8266: + board: d1_mini + +# Enable logging +logger: + +# Enable Home Assistant API +api: + +ota: + password: "b939363a379d690163ccf26abb97f3b0" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Waterproxy Fallback Hotspot" + password: "WUBVgixnxwE2" + +captive_portal: + +sensor: +- platform: pulse_meter + pin: GPIO12 + name: "Water Pulse Meter" + unit_of_measurement: "l/min" + icon: "mdi:water" + total: + name: "Water Total" + unit_of_measurement: "l" diff --git a/esphome/wavin9000.yaml b/esphome/wavin9000.yaml new file mode 100644 index 0000000..0cf882d --- /dev/null +++ b/esphome/wavin9000.yaml @@ -0,0 +1,96 @@ +esphome: + name: wavin9000 + +esp32: + board: nodemcu-32s + framework: + type: arduino + +# Enable logging +logger: + baud_rate: 0 + +# Enable Home Assistant API +api: + +ota: + password: "78e75f9b6126ee57de681fd33aeba979" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Wavin9000 Fallback Hotspot" + password: "27GtPUNzkJCo" + +captive_portal: + +packages: + remote_package: + url: https://github.com/dkgof/esphome_components + ref: main + files: + - components/wavinahc9000v2/configs/basic.yaml # REQUIRED FOR WAVIN AHC 9000 + - components/wavinahc9000v2/configs/channel_01.yaml + - components/wavinahc9000v2/configs/channel_02.yaml + - components/wavinahc9000v2/configs/channel_03.yaml + - components/wavinahc9000v2/configs/channel_04.yaml + - components/wavinahc9000v2/configs/channel_05.yaml + - components/wavinahc9000v2/configs/channel_06.yaml + - components/wavinahc9000v2/configs/channel_07.yaml + - components/wavinahc9000v2/configs/channel_08.yaml + - components/wavinahc9000v2/configs/channel_09.yaml + - components/wavinahc9000v2/configs/channel_10.yaml + - components/wavinahc9000v2/configs/channel_11.yaml + refresh: 0s + +uart: + - id: uart_${device} + rx_pin: GPIO16 + tx_pin: GPIO17 + baud_rate: 38400 + stop_bits: 1 + parity: NONE + +modbus: + - id: ${device}_modbus + uart_id: uart_${device} + +modbus_controller: + id: ${device}_modbus_controller + address: 1 + modbus_id: ${device}_modbus + update_interval: 30s + +substitutions: + # UNIQUE NAME FOR THE DEVICE + device: wavin9000 # Case sensitive!!! + name: "Wavin 9000" # "Friendly name" - not case sensitive!!! + + # CHANNEL friendly names (If using spaces remember to add ") + channel_01_friendly_name: "Bryggers" + channel_02_friendly_name: "Jens Værelse" + channel_03_friendly_name: "Gang" + channel_04_friendly_name: "Niels Værelse" + channel_05_friendly_name: "Køkken" + channel_06_friendly_name: "Køkken Dummy" + channel_07_friendly_name: "Kontor" + channel_08_friendly_name: "Soveværelse" + channel_09_friendly_name: "Stue" + channel_10_friendly_name: "Stort Badeværelse" + channel_11_friendly_name: "Lille Badeværelse" + + # CHANNEL ID´S (ONLY LOWER CASE LETTERS, NO SPACES) used for entity ids + channel_01_id: bryggers + channel_02_id: jens + channel_03_id: gang + channel_04_id: niels + channel_05_id: kokken + channel_06_id: kokken_dummy + channel_07_id: kontor + channel_08_id: sove + channel_09_id: stue + channel_10_id: stort_bad + channel_11_id: lille_bad diff --git a/groups.yaml b/groups.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/groups.yaml diff --git a/known_devices.yaml b/known_devices.yaml new file mode 100644 index 0000000..337cb4d --- /dev/null +++ b/known_devices.yaml @@ -0,0 +1,225 @@ + +16_1b_6e_4b_53_3a: + name: 16_1b_6e_4b_53_3a + mac: 16:1B:6E:4B:53:3A + icon: + picture: + track: false + +fe_a1_6e_ff_76_a7: + name: BeritJobMobil + mac: FE:A1:6E:FF:76:A7 + icon: + picture: + track: true + +c4_65_16_da_0f_fb: + name: c4_65_16_da_0f_fb + mac: C4:65:16:DA:0F:FB + icon: + picture: + track: false + +0c_96_e6_aa_ad_cf: + name: 0c_96_e6_aa_ad_cf + mac: 0C:96:E6:AA:AD:CF + icon: + picture: + track: false + +e0_b6_55_99_a7_65: + name: e0_b6_55_99_a7_65 + mac: E0:B6:55:99:A7:65 + icon: + picture: + track: false + +0c_b5_27_6b_f0_3b: + name: 0c_b5_27_6b_f0_3b + mac: 0C:B5:27:6B:F0:3B + icon: + picture: + track: false + +d6_33_15_35_c9_dc: + name: RolfMobil + mac: D6:33:15:35:C9:DC + icon: + picture: + gravatar: rolf@fambagge.dk + track: true + +70_ee_50_59_00_d6: + name: 70_ee_50_59_00_d6 + mac: 70:EE:50:59:00:D6 + icon: + picture: + track: false + +20_df_b9_0f_97_05: + name: 20_df_b9_0f_97_05 + mac: 20:DF:B9:0F:97:05 + icon: + picture: + track: false + +f4_bf_80_c1_5a_14: + name: BeritMobil + mac: F4:BF:80:C1:5A:14 + icon: + picture: + track: true + +34_7e_5c_32_6f_82: + name: 34_7e_5c_32_6f_82 + mac: 34:7E:5C:32:6F:82 + icon: + picture: + track: false + +64_90_c1_1a_7b_31: + name: 64_90_c1_1a_7b_31 + mac: 64:90:C1:1A:7B:31 + icon: + picture: + track: false + +38_78_62_45_2a_d6: + name: 38_78_62_45_2a_d6 + mac: 38:78:62:45:2A:D6 + icon: + picture: + track: false + +b0_eb_57_96_94_5a: + name: b0_eb_57_96_94_5a + mac: B0:EB:57:96:94:5A + icon: + picture: + track: false + +c0_ee_fb_bf_3f_3c: + name: c0_ee_fb_bf_3f_3c + mac: C0:EE:FB:BF:3F:3C + icon: + picture: + track: false + +ba_bc_ec_b4_17_a3: + name: ba_bc_ec_b4_17_a3 + mac: BA:BC:EC:B4:17:A3 + icon: + picture: + track: false + +72_1d_da_15_3c_90: + name: 72_1d_da_15_3c_90 + mac: 72:1D:DA:15:3C:90 + icon: + picture: + track: false + +74_1b_b2_67_ab_02: + name: 74_1b_b2_67_ab_02 + mac: 74:1B:B2:67:AB:02 + icon: + picture: + track: false + +10_02_b5_b2_d2_75: + name: 10_02_b5_b2_d2_75 + mac: 10:02:B5:B2:D2:75 + icon: + picture: + track: false + +28_cd_c4_20_b6_5b: + name: 28_cd_c4_20_b6_5b + mac: 28:CD:C4:20:B6:5B + icon: + picture: + track: false + +64_bc_0c_84_23_03: + name: 64_bc_0c_84_23_03 + mac: 64:BC:0C:84:23:03 + icon: + picture: + track: false + +8c_b8_4a_ae_ce_50: + name: 8c_b8_4a_ae_ce_50 + mac: 8C:B8:4A:AE:CE:50 + icon: + picture: + track: false + +18_31_bf_d4_ed_f8: + name: 18_31_bf_d4_ed_f8 + mac: 18:31:BF:D4:ED:F8 + icon: + picture: + track: false + +34_02_86_a6_c7_a5: + name: 34_02_86_a6_c7_a5 + mac: 34:02:86:A6:C7:A5 + icon: + picture: + track: false + +f8_27_93_cb_87_3c: + name: f8_27_93_cb_87_3c + mac: F8:27:93:CB:87:3C + icon: + picture: + track: false + +f6_d9_ba_97_7a_8b: + name: f6_d9_ba_97_7a_8b + mac: F6:D9:BA:97:7A:8B + icon: + picture: + track: false + +44_d7_91_db_d9_ff: + name: 44_d7_91_db_d9_ff + mac: 44:D7:91:DB:D9:FF + icon: + picture: + track: false + +cc_9f_7a_33_06_67: + name: cc_9f_7a_33_06_67 + mac: CC:9F:7A:33:06:67 + icon: + picture: + track: false + +00_24_8d_c9_22_6e: + name: 00_24_8d_c9_22_6e + mac: 00:24:8D:C9:22:6E + icon: + picture: + track: false + +9c_fc_01_42_f6_a6: + name: 9c_fc_01_42_f6_a6 + mac: 9C:FC:01:42:F6:A6 + icon: + picture: + track: false + +skoda_gps: + name: skoda_gps + mac: + icon: mdi:car + picture: + track: true + +a2_bd_9e_87_2a_f9: + name: a2_bd_9e_87_2a_f9 + mac: A2:BD:9E:87:2A:F9 + icon: + picture: + track: false diff --git a/lights.yaml b/lights.yaml new file mode 100644 index 0000000..e10261e --- /dev/null +++ b/lights.yaml @@ -0,0 +1,54 @@ +- platform: group + name: Gang Gruppe + entities: + - light.gang_1 + - light.gang_2 + - light.gang_3 + +- platform: group + name: Køkken Gruppe + entities: + - light.kokken + - light.kokken_2 + +- platform: group + name: Køkken Ø Gruppe + entities: + - light.kokken_o + - light.kokken_o_2 + +- platform: group + name: Spisebord Gruppe + entities: + - light.spisebord + - light.spisebord_2 + +- platform: group + name: All Lights Off + entities: + - light.gang_gruppe + - light.kokken_gruppe + - light.kokken_o_gruppe + - light.spisebord_gruppe + - light.kontor + - light.sofabord + - light.vetrineskab + - light.bryggers_indhak + - light.gaestevaerelse + - light.niels_seng + - light.niels_loft + - light.seng + +- platform: group + name: All Lights On + entities: + - light.gang_gruppe + - light.kokken_gruppe + - light.kokken_o_gruppe + - light.spisebord_gruppe + - light.kontor + - light.sofabord + - light.gaestevaerelse + - light.niels_seng + - light.niels_loft + - light.seng \ No newline at end of file diff --git a/scenes.yaml b/scenes.yaml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/scenes.yaml diff --git a/scripts.yaml b/scripts.yaml new file mode 100644 index 0000000..6dd4231 --- /dev/null +++ b/scripts.yaml @@ -0,0 +1,80 @@ +mibox_right: + alias: MiBox Right Arrow + sequence: + - service: androidtv.adb_command + target: + entity_id: media_player.mibox + data: + command: sendevent /dev/input/event2 4 4 786501 && sendevent /dev/input/event2 + 1 106 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 + 4 4 786501 && sendevent /dev/input/event2 1 106 0 && sendevent /dev/input/event2 + 0 0 0 +mibox_left: + alias: MiBox Left Arrow + sequence: + - service: androidtv.adb_command + target: + entity_id: media_player.mibox + data: + command: sendevent /dev/input/event2 4 4 786500 && sendevent /dev/input/event2 + 1 105 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 + 4 4 786500 && sendevent /dev/input/event2 1 105 0 && sendevent /dev/input/event2 + 0 0 0 +mibox_up: + alias: MiBox Left Up + sequence: + - service: androidtv.adb_command + target: + entity_id: media_player.mibox + data: + command: sendevent /dev/input/event2 4 4 786498 && sendevent /dev/input/event2 + 1 103 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 + 4 4 786498 && sendevent /dev/input/event2 1 103 0 && sendevent /dev/input/event2 + 0 0 0 +mibox_down: + alias: MiBox Left Down + sequence: + - service: androidtv.adb_command + target: + entity_id: media_player.mibox + data: + command: sendevent /dev/input/event2 4 4 786499 && sendevent /dev/input/event2 + 1 108 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 + 4 4 786499 && sendevent /dev/input/event2 1 108 0 && sendevent /dev/input/event2 + 0 0 0 +mibox_enter: + alias: MiBox Enter + sequence: + - service: androidtv.adb_command + target: + entity_id: media_player.mibox + data: + command: sendevent /dev/input/event2 4 4 786497 && sendevent /dev/input/event2 + 1 353 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 + 4 4 786497 && sendevent /dev/input/event2 1 353 0 && sendevent /dev/input/event2 + 0 0 0 +mibox_back: + alias: MiBox Back + sequence: + - service: androidtv.adb_command + target: + entity_id: media_player.mibox + data: + command: sendevent /dev/input/event2 4 4 786980 && sendevent /dev/input/event2 + 1 158 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 + 4 4 786980 && sendevent /dev/input/event2 1 158 0 && sendevent /dev/input/event2 + 0 0 0 +mibox_home: + alias: MiBox Home + sequence: + - service: androidtv.adb_command + target: + entity_id: media_player.mibox + data: + command: sendevent /dev/input/event2 4 4 786979 && sendevent /dev/input/event2 + 1 172 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 + 4 4 786979 && sendevent /dev/input/event2 1 172 0 && sendevent /dev/input/event2 + 0 0 0 +'1661619001115': + alias: Nyt script + sequence: [] diff --git a/sensors/energy.yaml b/sensors/energy.yaml new file mode 100644 index 0000000..8e8c44d --- /dev/null +++ b/sensors/energy.yaml @@ -0,0 +1,44 @@ +- platform: integration + source: sensor.solcelle_produktion + name: energy_generated + unit_prefix: k + unit_time: h + round: 8 + +- platform: integration + source: sensor.tv_baenk_energi + name: tv_baenk_power_used + unit_prefix: k + unit_time: h + round: 4 + +- platform: integration + source: sensor.aircondition_energi + name: aircondition_power_used + unit_prefix: k + unit_time: h + round: 4 + +- platform: statistics + name: Average energy price last 30d mean + entity_id: sensor.energi_data_service + state_characteristic: mean + sampling_size: 760 + max_age: + days: 30 + +- platform: statistics + name: Energy price last 30d (std) + entity_id: sensor.energi_data_service + state_characteristic: standard_deviation + sampling_size: 512 + max_age: + days: 30 + +- platform: statistics + name: Energy price last 30d (mean) + entity_id: sensor.energi_data_service + state_characteristic: mean + sampling_size: 512 + max_age: + days: 30 \ No newline at end of file diff --git a/sensors/igrill.yaml b/sensors/igrill.yaml new file mode 100644 index 0000000..e6758e3 --- /dev/null +++ b/sensors/igrill.yaml @@ -0,0 +1,12 @@ +- platform: template + sensors: + target_alert_temp_probe_1: + value_template: + '{% if (states.sensor.igrill_temperature.state | int(default=0)) >= (states.input_number.grill_probe_1_target.state | int) %} + Alert + {% elif (states.sensor.igrill_temperature.state | int(default=0)) >= (states.input_number.grill_probe_1_target.state | int) - 4 %} + Ready + {% else %} + Cooking + {% endif %}' + friendly_name: iGrill Target Alert \ No newline at end of file diff --git a/sensors/speedtest.yaml b/sensors/speedtest.yaml new file mode 100644 index 0000000..7caedb8 --- /dev/null +++ b/sensors/speedtest.yaml @@ -0,0 +1,10 @@ +- platform: command_line + name: Speedtest Data + command: "/config/shell_commands/speedtest --format=json --accept-license --accept-gdpr" + command_timeout: 60 + value_template: "OK" + scan_interval: 3600 + json_attributes: + - download + - upload + - ping diff --git a/sensors/vacuum.yaml b/sensors/vacuum.yaml new file mode 100644 index 0000000..74a5786 --- /dev/null +++ b/sensors/vacuum.yaml @@ -0,0 +1,24 @@ +- platform: template + sensors: + vacuum_card_filter: + value_template: "{{ ((states.sensor.roborock_vacuum_s5e_filter_left.state | float(default=0) / 3600)) | round(0) }}" + unit_of_measurement: "hours" + +- platform: template + sensors: + vacuum_card_sidebrush: + value_template: "{{ ((states.sensor.roborock_vacuum_s5e_side_brush_left.state | float(default=0) / 3600)) | round(0) }}" + unit_of_measurement: "hours" + +- platform: template + sensors: + vacuum_card_sensors: + value_template: "{{ ((states.sensor.roborock_vacuum_s5e_sensor_dirty_left.state | float(default=0) / 3600)) | round(0) }}" + unit_of_measurement: "hours" + +- platform: template + sensors: + vacuum_card_mainbrush: + value_template: "{{ ((states.sensor.roborock_vacuum_s5e_main_brush_left.state | float(default=0) / 3600)) | round(0) }}" + unit_of_measurement: "hours" + \ No newline at end of file diff --git a/shell_commands/speedtest b/shell_commands/speedtest new file mode 100755 index 0000000..37e33b0 --- /dev/null +++ b/shell_commands/speedtest Binary files differ diff --git a/shell_commands/speedtest.5 b/shell_commands/speedtest.5 new file mode 100644 index 0000000..762396b --- /dev/null +++ b/shell_commands/speedtest.5 @@ -0,0 +1,489 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "SPEEDTEST" "" "November 2021" "" "" +. +.SH "Name" +\fBspeedtest\fR \- Speedtest CLI by Ookla is the official command line client for testing the speed and performance of your internet connection\. +. +.SH "Version" +1\.1\.1 +. +.SH "Synopsis" +. +.nf + + speedtest [\-aAbBfhiIpPsv] [\-\-ca\-certificate=path] [\-\-format=[=format\-type]] [\-\-help] [\-\-interface=interface] + [\-\-ip=ip_address] [\-\-output\-header] [\-\-precision=num_decimal_places] [\-\-progress=yes|no] + [\-\-selection\-details] [\-\-server\-id=id] [\-\-servers] [\-\-unit=[=unit\-of\-measure]] [\-\-version] +. +.fi +. +.SH "Description" +\fBspeedtest\fR is an application that measures the latency, jitter, packet loss, download bandwidth, and upload bandwidth of the network connection between the client and a nearby Speedtest Server\. +. +.SH "Options" +. +.IP "\(bu" 4 +\fB\-h, \-\-help\fR +. +.br +Print usage information +. +.IP "\(bu" 4 +\fB\-v\fR Logging verbosity, specify multiple times for higher verbosity (e\.g\. \fB\-vvv\fR) +. +.IP "\(bu" 4 +\fB\-V, \-\-version\fR Print version number +. +.IP "\(bu" 4 +\fB\-L, \-\-servers\fR List nearest servers +. +.IP "\(bu" 4 +\fB\-\-selection\-details\fR Show server selection details +. +.IP "\(bu" 4 +\fB\-s\fR \fIid\fR, \fB\-\-server\-id\fR=\fIid\fR +. +.br +Specify a server from the server list using its id +. +.IP "\(bu" 4 +\fB\-o\fR \fIhostname\fR, \fB\-\-host\fR=\fIhostname\fR +. +.br +Specify a server from the server list using its hostname +. +.IP "\(bu" 4 +\fB\-f\fR \fIformat_type\fR \fB\-\-format\fR=\fIformat_type\fR +. +.br +Output format (default = human\-readable) Note: Machine readable formats (csv, tsv, json, jsonl, json\-pretty) use bytes as the unit of measure with max precision\. +. +.IP +\fIformat_type\fR values are as follows: +. +.IP "\(bu" 4 +\fBhuman\-readable\fR human readable output +. +.IP "\(bu" 4 +\fBcsv\fR comma separated values +. +.IP "\(bu" 4 +\fBtsv\fR tab separated values +. +.IP "\(bu" 4 +\fBjson\fR javascript object notation (compact) +. +.IP "\(bu" 4 +\fBjsonl\fR javascript object notation (lines) +. +.IP "\(bu" 4 +\fBjson\-pretty\fR javascript object notation (pretty) +. +.IP "" 0 + +. +.IP "\(bu" 4 +\fB\-\-progress\-update\-interval\fR=\fIinterval\fR Progress update interval (100\-1000 milliseconds) +. +.IP "\(bu" 4 +\fB\-\-output\-header\fR Show output header for CSV and TSV formats +. +.IP "\(bu" 4 +\fB\-u\fR\fIunit_of_measure\fR\fB,\~\-\-unit\fR\fIunit_of_measure\fR Output unit for displaying speeds (Note: this is only applicable for ‘human\-readable’ output format and the default unit is Mbps) +. +.IP "\(bu" 4 +\fBbps\fR bits per second (decimal prefix) +. +.IP "\(bu" 4 +\fBkbps\fR kilobits per second (decimal prefix) +. +.IP "\(bu" 4 +\fBMbps\fR megabits per second (decimal prefix) +. +.IP "\(bu" 4 +\fBGbps\fR gigabits per second (decimal prefix) +. +.IP "\(bu" 4 +\fBkibps\fR kilobits per second (binary prefix) +. +.IP "\(bu" 4 +\fBMibps\fR megabits per second (binary prefix) +. +.IP "\(bu" 4 +\fBGibps\fR gigabits per second (binary prefix) +. +.IP "\(bu" 4 +\fBB/s\fR bytes per second +. +.IP "\(bu" 4 +\fBkB/s\fR kilobytes per second +. +.IP "\(bu" 4 +\fBMB/s\fR megabytes per second +. +.IP "\(bu" 4 +\fBGiB/s\fR gigabytes per second +. +.IP "\(bu" 4 +\fBauto\-binary\-bytes\fR automatic in binary bytes +. +.IP "\(bu" 4 +\fBauto\-decimal\-bytes\fR automatic in decimal bytes +. +.IP "\(bu" 4 +\fBauto\-binary\-bytes\fR automatic in binary bits +. +.IP "\(bu" 4 +\fBauto\-binary\-bytes\fR automatic in decimal bits +. +.IP "" 0 + +. +.IP "\(bu" 4 +\fB\-a\fR +. +.br +Shortcut for [\fB\-u auto\-decimal\-bits\fR] +. +.IP "\(bu" 4 +\fB\-A\fR +. +.br +Shortcut for [\fB\-u auto\-decimal\-bytes\fR] +. +.IP "\(bu" 4 +\fB\-b\fR +. +.br +Shortcut for [\fB\-u auto\-binary\-bits\fR] +. +.IP "\(bu" 4 +\fB\-B\fR +. +.br +Shortcut for [\fB\-u auto\-binary\-bytes\fR] +. +.IP "\(bu" 4 +\fB\-P\fR \fIdecimal_places\fR \fB\-\-precision\fR=\fIdecimal_places\fR +. +.br +Number of decimal_places to use (default = 2, valid = 0\-8) +. +.IP "\(bu" 4 +\fB\-p\fR \fIyes\fR|\fIno\fR \fB\-\-progress\fR=\fIyes\fR|\fIno\fR +. +.br +Enable or disable progress bar (default = yes when interactive) +. +.IP "\(bu" 4 +\fB\-I\fR \fIinterface\fR \fB\-\-interface\fR=\fIinterface\fR Attempt to bind to the specified interface when connecting to servers +. +.IP "\(bu" 4 +\fB\-i\fR \fIip_address\fR \fB\-\-ip\fR=\fIip_address\fR Attempt to bind to the specified IP address when connecting to servers +. +.IP "\(bu" 4 +\fB\-\-ca\-certificate\fR=\fIpath\fR Path to CA Certificate bundle, see note below\. +. +.IP "" 0 +. +.SH "Terms of Use and Privacy Policy Notices" +You may only use this Speedtest software and information generated from it for personal, non\-commercial use, through a command line interface on a personal computer\. Your use of this software is subject to the End User License Agreement, Terms of Use and Privacy Policy at these URLs: +. +.IP "\(bu" 4 +\fIhttps://www\.speedtest\.net/about/eula\fR +. +.IP "\(bu" 4 +\fIhttps://www\.speedtest\.net/about/terms\fR +. +.IP "\(bu" 4 +\fIhttps://www\.speedtest\.net/about/privacy\fR +. +.IP "" 0 +. +.SH "Output" +Upon successful execution, the application will exit with an exit code of 0\. The result will include latency, jitter, download, upload, packet loss (where available), and a result URL\. +. +.P +Latency and jitter will be represented in milliseconds\. Download and upload units will depend on the output format as well as if a unit was specified\. The human\-readable format defaults to Mbps and any machine\-readable formats (csv, tsv, json, jsonl, json\-pretty) use bytes as the unit of measure with max precision\. Packet loss is represented as a percentage, or \fBNot available\fR when packet loss is unavailable in the executing network environment\. +. +.P +The bytes per second measurements can be transformed into the human\-readable output format default unit of megabits (Mbps) by dividing the bytes per second value by 125,000\. For example: +. +.P +38404104 bytes per second = 38404104 / 125 = 307232\.832 kilobits per second = 307232\.832 / 1000 = 307\.232832 megabits per second +. +.P +The value 125 is derived from 1000 / 8 as follows: +. +.P +1 byte = 8 bits 1 kilobit = 1000 bits +. +.P +38404104 bytes per second = 38404104 * 8 bits per byte = 307232832 bits per second = 307232832 / 1000 bits per kilobit = 307232\.832 kilobits per second +. +.P +The Result URL is available to share your result, appending \fB\.png\fR to the Result URL will create a shareable result image\. +. +.P +\fIExample human\-readable result:\fR +. +.IP "" 4 +. +.nf + +$ speedtest + Speedtest by Ookla + + Server: Speedtest\.net \- New York, NY (id = 10390) + ISP: Comcast Cable + Latency: 57\.81 ms (3\.65 ms jitter) + Download: 76\.82 Mbps (data used: 80\.9 MB) + Upload: 37\.58 Mbps (data used: 65\.3 MB) +Packet Loss: 0\.0% + Result URL: https://www\.speedtest\.net/result/c/8ae1200c\-e639\-45e5\-8b55\-41421a079250 +. +.fi +. +.IP "" 0 +. +.SH "Network Timeout Values" +By default, network requests set a timeout of \fB10\fR seconds\. The only exception to this is latency testing, which sets a timeout of \fB15\fR seconds\. +. +.SH "Fatal Errors" +Upon fatal errors, the application will exit with a non\-zero exit code\. +. +.P +\fBInitialization Fatal Error Examples:\fR +. +.P +\fIConfiguration \- Couldn\'t connect to server (Network is unreachable)\fR +. +.P +\fIConfiguration \- Could not retrieve or read configuration (ConfigurationError)\fR +. +.P +\fBStage Execution Fatal Error Example:\fR +. +.P +\fI[error] Error: [1] Latency test failed for HTTP\fR +. +.P +\fI[error] Error: [36] Cannot open socket: Operation now in progress\fR +. +.P +\fI[error] Failed to resolve host name\. Cancelling test suite\.\fR +. +.P +\fI[error] Host resolve failed: Exec format error\fR +. +.P +\fI[error] Cannot open socket: No route to host\fR +. +.P +\fI[error] Server Selection \- Failed to find a working test server\. (NoServers)\fR +. +.SH "SSL Certificate Locations" +By default the following paths are checked for CA certificate bundles on linux machines: +. +.IP "" 4 +. +.nf + +/etc/ssl/certs/ca\-certificates\.crt +/etc/pki/tls/certs/ca\-bundle\.crt +/usr/share/ssl/certs/ca\-bundle\.crt +/usr/local/share/certs/ca\-root\-nss\.crt +/etc/ssl/cert\.pem +. +.fi +. +.IP "" 0 +. +.P +If the device under test does \fInot\fR have one of the above mentioned files, then the canonical and up to date CA certificate bundle provided by the curl project can be manually downloaded into a specific location\. This specific location can be provided as a parameter per the following example: +. +.IP "" 4 +. +.nf + +wget https://curl\.haxx\.se/ca/cacert\.pem +\./ookla \-\-ca\-certificate=\./cacert\.pem +. +.fi +. +.IP "" 0 +. +.SH "Release Notes" +. +.SS "1\.1\.1 \- 11/15/2021" +. +.IP "\(bu" 4 +Fixed issue with reported client version in uploaded results +. +.IP "" 0 +. +.SS "1\.1\.0 \- 10/27/2021" +. +.IP "\(bu" 4 +Use server\-side upload measurements +. +.IP "\(bu" 4 +Performance enhancement on upload tests for CPU constrained devices +. +.IP "\(bu" 4 +Security enhancements +. +.IP "\(bu" 4 +Fix for deadlock bug +. +.IP "\(bu" 4 +Fix crash due to race condition +. +.IP "\(bu" 4 +Fix crash in hostname resolution during test initialization +. +.IP "\(bu" 4 +Fix potential buffer overflow +. +.IP "\(bu" 4 +Update Boost to 1\.77\.0 +. +.IP "\(bu" 4 +Update mbedTLS to 2\.27\.0 +. +.IP "\(bu" 4 +Update cURL to 7\.78\.0 +. +.IP "" 0 +. +.SS "1\.0\.0 \- 10/29/2019" +. +.IP "\(bu" 4 +Initial release +. +.IP "" 0 +. +.SH "Copyright Notices for Third\-Party Products/Libraries" +This software incorporates free and open source third\-party libraries, including: +. +.IP "\(bu" 4 +boost \fIhttps://www\.boost\.org/\fR +. +.IP "\(bu" 4 +libcurl \fIhttps://curl\.haxx\.se/libcurl/\fR +. +.IP "\(bu" 4 +petopt \fIhttps://www\.lysator\.liu\.se/~pen/petopt/\fR +. +.IP "\(bu" 4 +mbed TLS \fIhttps://tls\.mbed\.org/\fR +. +.IP "\(bu" 4 +ca\-certificates extract \fIhttps://curl\.haxx\.se/docs/caextract\.html\fR +. +.IP "\(bu" 4 +L\. Peter Deutsch’s md5 \fIhttps://sourceforge\.net/projects/libmd5\-rfc/files/\fR +. +.IP "\(bu" 4 +getopt\.h \fIin%20Windows%20version%20of%20this%20software\fR +. +.IP "\(bu" 4 +tiny\-aes \fIhttps://github\.com/kokke/tiny\-AES\-c\fR +. +.IP "\(bu" 4 +PicoSHA2 \fIhttps://github\.com/okdshin/PicoSHA2\fR +. +.IP "\(bu" 4 +musl \fIhttps://www\.musl\-libc\.org/\fR +. +.IP "" 0 +. +.P +Inclusion of mbed TLS is subject to presentation of the following license terms to recipients of this software: \fIhttp://www\.apache\.org/licenses/LICENSE\-2\.0\fR (a copy of which is included with the documentation of this software) +. +.SS "Inclusion of libcurl is subject to distribution of the software with the following notice:" +. +.nf + +Copyright (c) 1996 \- 2019, Daniel Stenberg, daniel@haxx\.se, and many contributors, +see the THANKS file\. All rights reserved\. Permission to use, copy, modify, and distribute +this software for any purpose with or without fee is hereby granted, provided that +the above copyright notice and this permission notice appear in all copies\. +. +.fi +. +.SS "Inclusion of getopt\.h is subject to distribution of the software with the following notice:" +. +.nf + +DISCLAIMER +This file is part of the mingw\-w64 runtime package\. + +The mingw\-w64 runtime package and its code is distributed in the hope that it +will be useful but WITHOUT ANY WARRANTY\. ALL WARRANTIES, EXPRESSED OR +IMPLIED ARE HEREBY DISCLAIMED\. This includes but is not limited to +warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\. + + +Copyright (c) 2002 Todd C\. Miller + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies\. + +Copyright (c) 2000 The NetBSD Foundation, Inc\. +All rights reserved\. + +This code is derived from software contributed to The NetBSD Foundation +by Dieter Baron and Thomas Klausner\. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1\. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer\. +2\. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution\. +. +.fi +. +.SS "Inclusion of PicoSHA2 is subject to distribution of the software with the following notice:" +. +.nf + +Copyright (c) 2017 okdshin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software\. +. +.fi +. +.SS "Inclusion of musl is subject to distribution of the software with the following notice:" +. +.nf + +Copyright © 2005\-2019 Rich Felker, et al\. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software\. +. +.fi + diff --git a/shell_commands/speedtest.md b/shell_commands/speedtest.md new file mode 100644 index 0000000..d2e0412 --- /dev/null +++ b/shell_commands/speedtest.md @@ -0,0 +1,303 @@ +# Speedtest + +## Name + **speedtest** - Speedtest CLI by Ookla is the official command line client for testing the speed and performance of your internet connection. + +## Version + 1.1.1 + +## Synopsis +``` + speedtest [-aAbBfhiIpPsv] [--ca-certificate=path] [--format=[=format-type]] [--help] [--interface=interface] + [--ip=ip_address] [--output-header] [--precision=num_decimal_places] [--progress=yes|no] + [--selection-details] [--server-id=id] [--servers] [--unit=[=unit-of-measure]] [--version] +``` + +## Description +**speedtest** is an application that measures the latency, jitter, packet loss, download bandwidth, and +upload bandwidth of the network connection between the client and a nearby Speedtest +Server. + +## Options +* **-h, --help** + Print usage information + +* **-v** + Logging verbosity, specify multiple times for higher verbosity (e.g. **-vvv**) + +* **-V, --version** + Print version number + +* **-L, --servers** + List nearest servers + +* **--selection-details** + Show server selection details + +* **-s** *id*, **--server-id**=*id* + Specify a server from the server list using its id + +* **-o** *hostname*, **--host**=*hostname* + Specify a server from the server list using its hostname + +* **-f** *format_type* **--format**=*format_type* + Output format (default = human-readable) + Note: Machine readable formats (csv, tsv, json, jsonl, json-pretty) use bytes + as the unit of measure with max precision. + + *format_type* values are as follows: + * **human-readable** human readable output + * **csv** comma separated values + * **tsv** tab separated values + * **json** javascript object notation (compact) + * **jsonl** javascript object notation (lines) + * **json-pretty** javascript object notation (pretty) + +* **--progress-update-interval**=*interval* + Progress update interval (100-1000 milliseconds) + +* **--output-header** + Show output header for CSV and TSV formats + +* **-u*** unit_of_measure***, --unit*** unit_of_measure* + Output unit for displaying speeds (Note: this is only applicable + for ‘human-readable’ output format and the default unit is Mbps) + + * **bps** bits per second (decimal prefix) + * **kbps** kilobits per second (decimal prefix) + * **Mbps** megabits per second (decimal prefix) + * **Gbps** gigabits per second (decimal prefix) + * **kibps** kilobits per second (binary prefix) + * **Mibps** megabits per second (binary prefix) + * **Gibps** gigabits per second (binary prefix) + * **B/s** bytes per second + * **kB/s** kilobytes per second + * **MB/s** megabytes per second + * **GiB/s** gigabytes per second + * **auto-binary-bytes** automatic in binary bytes + * **auto-decimal-bytes** automatic in decimal bytes + * **auto-binary-bytes** automatic in binary bits + * **auto-binary-bytes** automatic in decimal bits + +* **-a** + Shortcut for [**-u auto-decimal-bits**] + +* **-A** + Shortcut for [**-u auto-decimal-bytes**] + +* **-b** + Shortcut for [**-u auto-binary-bits**] + +* **-B** + Shortcut for [**-u auto-binary-bytes**] + +* **-P** *decimal_places* **--precision**=*decimal_places* + Number of decimal_places to use (default = 2, valid = 0-8) + +* **-p** *yes*|*no* **--progress**=*yes*|*no* + Enable or disable progress bar (default = yes when interactive) + +* **-I** *interface* **--interface**=*interface* + Attempt to bind to the specified interface when connecting to servers + +* **-i** *ip_address* **--ip**=*ip_address* + Attempt to bind to the specified IP address when connecting to servers + +* **--ca-certificate**=*path* + Path to CA Certificate bundle, see note below. + +## Terms of Use and Privacy Policy Notices +You may only use this Speedtest software and information generated from it for personal, non-commercial use, +through a command line interface on a personal computer. Your use of this software is subject to the End User +License Agreement, Terms of Use and Privacy Policy at these URLs: + +* [https://www.speedtest.net/about/eula](https://www.speedtest.net/about/eula) +* [https://www.speedtest.net/about/terms](https://www.speedtest.net/about/terms) +* [https://www.speedtest.net/about/privacy](https://www.speedtest.net/about/privacy) + +## Output +Upon successful execution, the application will exit with an exit code of 0. The result will include +latency, jitter, download, upload, packet loss (where available), and a result URL. + +Latency and jitter will be represented in milliseconds. Download and upload units will depend on the output +format as well as if a unit was specified. The human-readable format defaults to Mbps and any machine-readable +formats (csv, tsv, json, jsonl, json-pretty) use bytes as the unit of measure with max precision. Packet loss is represented as a percentage, or **Not available** when packet loss is unavailable in the executing network environment. + +The bytes per second measurements can be transformed into the human-readable output format +default unit of megabits (Mbps) by dividing the bytes per second value by 125,000. For example: + +38404104 bytes per second = 38404104 / 125 = 307232.832 kilobits per second = 307232.832 / 1000 = 307.232832 megabits per second + +The value 125 is derived from 1000 / 8 as follows: + +1 byte = 8 bits +1 kilobit = 1000 bits + +38404104 bytes per second = 38404104 * 8 bits per byte = 307232832 bits per second = 307232832 / 1000 bits per kilobit = 307232.832 kilobits per second + +The Result URL is available to share your result, appending **.png** to the Result URL will create a +shareable result image. + +*Example human-readable result:* + +``` +$ speedtest + Speedtest by Ookla + + Server: Speedtest.net - New York, NY (id = 10390) + ISP: Comcast Cable + Latency: 57.81 ms (3.65 ms jitter) + Download: 76.82 Mbps (data used: 80.9 MB) + Upload: 37.58 Mbps (data used: 65.3 MB) +Packet Loss: 0.0% + Result URL: https://www.speedtest.net/result/c/8ae1200c-e639-45e5-8b55-41421a079250 +``` + +## Network Timeout Values +By default, network requests set a timeout of **10** seconds. The only exception to this +is latency testing, which sets a timeout of **15** seconds. + +## Fatal Errors +Upon fatal errors, the application will exit with a non-zero exit code. + +**Initialization Fatal Error Examples:** + +*Configuration - Couldn't connect to server (Network is unreachable)* + +*Configuration - Could not retrieve or read configuration (ConfigurationError)* + +**Stage Execution Fatal Error Example:** + +*[error] Error: [1] Latency test failed for HTTP* + +*[error] Error: [36] Cannot open socket: Operation now in progress* + +*[error] Failed to resolve host name. Cancelling test suite.* + +*[error] Host resolve failed: Exec format error* + +*[error] Cannot open socket: No route to host* + +*[error] Server Selection - Failed to find a working test server. (NoServers)* + +## SSL Certificate Locations +By default the following paths are checked for CA certificate bundles on linux machines: + + /etc/ssl/certs/ca-certificates.crt + /etc/pki/tls/certs/ca-bundle.crt + /usr/share/ssl/certs/ca-bundle.crt + /usr/local/share/certs/ca-root-nss.crt + /etc/ssl/cert.pem + +If the device under test does *not* have one of the above mentioned files, then the canonical and up to date CA certificate bundle provided by the curl project can be manually +downloaded into a specific location. This specific location can be provided as a parameter per the following example: + + wget https://curl.haxx.se/ca/cacert.pem + ./ookla --ca-certificate=./cacert.pem + +## Release Notes + +### 1.1.1 - 11/15/2021 +* Fixed issue with reported client version in uploaded results + +### 1.1.0 - 10/27/2021 +* Use server-side upload measurements +* Performance enhancement on upload tests for CPU constrained devices +* Security enhancements +* Fix for deadlock bug +* Fix crash due to race condition +* Fix crash in hostname resolution during test initialization +* Fix potential buffer overflow +* Update Boost to 1.77.0 +* Update mbedTLS to 2.27.0 +* Update cURL to 7.78.0 + +### 1.0.0 - 10/29/2019 +* Initial release + +## Copyright Notices for Third-Party Products/Libraries +This software incorporates free and open source third-party libraries, including: + +* [boost](https://www.boost.org/) +* [libcurl](https://curl.haxx.se/libcurl/) +* [petopt](https://www.lysator.liu.se/~pen/petopt/) +* [mbed TLS](https://tls.mbed.org/) +* [ca-certificates extract](https://curl.haxx.se/docs/caextract.html) +* [L. Peter Deutsch’s md5](https://sourceforge.net/projects/libmd5-rfc/files/) +* [getopt.h](in Windows version of this software) +* [tiny-aes](https://github.com/kokke/tiny-AES-c) +* [PicoSHA2](https://github.com/okdshin/PicoSHA2) +* [musl](https://www.musl-libc.org/) + +Inclusion of mbed TLS is subject to presentation of the following license terms +to recipients of this software: [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) +(a copy of which is included with the documentation of this software) + +### Inclusion of libcurl is subject to distribution of the software with the following notice: + + Copyright (c) 1996 - 2019, Daniel Stenberg, daniel@haxx.se, and many contributors, + see the THANKS file. All rights reserved. Permission to use, copy, modify, and distribute + this software for any purpose with or without fee is hereby granted, provided that + the above copyright notice and this permission notice appear in all copies. + +### Inclusion of getopt.h is subject to distribution of the software with the following notice: + + DISCLAIMER + This file is part of the mingw-w64 runtime package. + + The mingw-w64 runtime package and its code is distributed in the hope that it + will be useful but WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESSED OR + IMPLIED ARE HEREBY DISCLAIMED. This includes but is not limited to + warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + + Copyright (c) 2002 Todd C. Miller + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + Copyright (c) 2000 The NetBSD Foundation, Inc. + All rights reserved. + + This code is derived from software contributed to The NetBSD Foundation + by Dieter Baron and Thomas Klausner. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +### Inclusion of PicoSHA2 is subject to distribution of the software with the following notice: + + Copyright (c) 2017 okdshin + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + +### Inclusion of musl is subject to distribution of the software with the following notice: + + Copyright © 2005-2019 Rich Felker, et al. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + diff --git a/template/aircondition.yaml b/template/aircondition.yaml new file mode 100644 index 0000000..d04a411 --- /dev/null +++ b/template/aircondition.yaml @@ -0,0 +1,15 @@ +- sensor: + - name: AirCondition Energi + state: '{{ states.switch.aircondition_switch.attributes.current_consumption }}' + unit_of_measurement: "W" + device_class: power + + - name: AirCondition Spænding + state: '{{ states.switch.aircondition_switch.attributes.voltage }}' + unit_of_measurement: "V" + device_class: voltage + + - name: AirCondition Strøm + state: '{{ (states.switch.aircondition_switch.attributes.current) | float * 0.001 }}' + unit_of_measurement: "A" + device_class: current \ No newline at end of file diff --git a/template/historic_energy_price.yaml b/template/historic_energy_price.yaml new file mode 100644 index 0000000..39111d1 --- /dev/null +++ b/template/historic_energy_price.yaml @@ -0,0 +1,13 @@ +- sensor: + - name: Historic Energy Price Percentiles + unique_id: historic_energy_price_percentiles + state: OK + attributes: + 25th: "{{ states('sensor.average_energy_price_last_30d_mean') | float + states('sensor.energy_price_last_30d_std') | float * -0.63 }}" + 50th: "{{ states('sensor.average_energy_price_last_30d_mean') | float + states('sensor.energy_price_last_30d_std') | float * 0 }}" + 75th: "{{ states('sensor.average_energy_price_last_30d_mean') | float + states('sensor.energy_price_last_30d_std') | float * 0.57 }}" + 90th: "{{ states('sensor.average_energy_price_last_30d_mean') | float + states('sensor.energy_price_last_30d_std') | float * 1.29 }}" + 95th: "{{ states('sensor.average_energy_price_last_30d_mean') | float + states('sensor.energy_price_last_30d_std') | float * 1.65 }}" + 99th: "{{ states('sensor.average_energy_price_last_30d_mean') | float + states('sensor.energy_price_last_30d_std') | float * 2.33 }}" + 100th: "{{ states('sensor.average_energy_price_last_30d_mean') | float + states('sensor.energy_price_last_30d_std') | float * 3.9 }}" + diff --git a/template/speedtest.yaml b/template/speedtest.yaml new file mode 100644 index 0000000..b2573f3 --- /dev/null +++ b/template/speedtest.yaml @@ -0,0 +1,15 @@ +- sensor: + - name: Speedtest Ping + state: '{{ ((state_attr("sensor.speedtest_data", "ping").latency | float )) | round(2) }}' + unit_of_measurement: ms + state_class: measurement + + - name: Speedtest Download + state: '{{ ((state_attr("sensor.speedtest_data", "download").bandwidth | int ) * 8 / 1000000) | round(2) }}' + unit_of_measurement: Mbit/s + state_class: measurement + + - name: Speedtest Upload + state: '{{ ((state_attr("sensor.speedtest_data", "upload").bandwidth | int ) * 8 / 1000000) | round(2) }}' + unit_of_measurement: Mbit/s + state_class: measurement diff --git a/template/tv_baenk.yaml b/template/tv_baenk.yaml new file mode 100644 index 0000000..782c1a3 --- /dev/null +++ b/template/tv_baenk.yaml @@ -0,0 +1,15 @@ +-sensor: + - name: TV Bænk Spænding + state: '{{ states.switch.tv_baenk.attributes.voltage }}' + unit_of_measurement: "V" + device_class: voltage + + - name: TV Bænk Strøm + state: '{{ (states.switch.tv_baenk.attributes.current) | float * 0.001 }}' + unit_of_measurement: "A" + device_class: current + + - name: TV Bænk Energi + state: '{{ states.switch.tv_baenk.attributes.current_consumption }}' + unit_of_measurement: "W" + device_class: power diff --git a/themes.yaml b/themes.yaml new file mode 100644 index 0000000..4c3601e --- /dev/null +++ b/themes.yaml @@ -0,0 +1,207 @@ +darkred: + # Main colors that can be changed + dark-primary-color: "#c66900" + disabled-text-color: "#545454" + divider-color: "rgba(255, 255, 255, 0.12)" + light-primary-color: "#e06c6c" + paper-card-background-color: "#1d1d1d" + paper-grey-200: "#191919" + paper-item-icon-color: "#d3d3d3" + paper-listbox-background-color: "#202020" + primary-background-color: "#303030" + primary-color: "#d32f2f" + primary-text-color: "#cfcfcf" + secondary-background-color: "#131313" + sidebar-text_-_background: "#62717b" + # Colors based on variables, see above + paper-card-header-color: "var(--paper-item-icon-color)" + paper-item-icon-active-color: "var(--primary-color)" + paper-item-icon_-_color: "var(--primary-text-color)" + paper-listbox-color: "var(--primary-text-color)" + paper-grey-50: "var(--primary-text-color)" + paper-slider-active-color: "var(--primary-color)" + paper-slider-knob-color: "var(--primary-color)" + paper-slider-knob-start-color: "var(--primary-color)" + paper-slider-pin-color: "var(--primary-color)" + paper-slider-secondary-color: "var(--light-primary-color)" + paper-toggle-button-checked-ink-color: "var(--dark-primary-color)" + paper-toggle-button-checked-button-color: "var(--primary-color)" + paper-toggle-button-checked-bar-color: "var(--light-primary-color)" + paper-toggle-button-unchecked-bar-color: "var(--primary-text-color)" + secondary-text-color: "var(--primary-color)" + table-row-background-color: "var(--paper-card-background-color)" + table-row-alternative-background-color: "var(--sidebar-text_-_background)" + +darkcyan: + # Main colors that can be changed + primary-color: "#00bcd4" + disabled-text-color: "#545454" + divider-color: "rgba(255, 255, 255, 0.12)" + paper-card-background-color: "#4e4e4e" + paper-grey-200: "#191919" + paper-item-icon-color: "#d3d3d3" + paper-listbox-background-color: "#202020" + paper-listbox-color: "#FFFFFF" + primary-background-color: "#303030" + primary-text-color: "#cfcfcf" + secondary-background-color: "#2b2b2b" + secondary-text-color: "#04a7bc" + # Colors based on variables, see above + label-badge-background-color: "var(--secondary-background-color)" + label-badge-text-color: "var(--text-primary-color)" + paper-card-header-color: "#var(--paper-item-icon-color)" + paper-grey-50: "var(--primary-text-color)" + paper-item-icon-active-color: "var(--primary-color)" + paper-item-icon_-_color: "var(--primary-text-color)" + paper-slider-active-color: "var(--primary-color)" + paper-slider-knob-color: "var(--primary-color)" + paper-slider-knob-start-color: "var(--primary-color)" + paper-slider-pin-color: "var(--primary-color)" + paper-slider-secondary-color: "var(--light-primary-color)" + paper-toggle-button-checked-ink-color: "var(--dark-primary-color)" + paper-toggle-button-checked-button-color: "var(--primary-color)" + paper-toggle-button-checked-bar-color: "var(--light-primary-color)" + paper-toggle-button-unchecked-bar-color: "var(--primary-text-color)" + +midnight: + # Main colors + primary-color: '#5294E2' # Header + accent-color: '#E45E65' # Accent color + dark-primary-color: 'var(--accent-color)' # Hyperlinks + light-primary-color: 'var(--accent-color)' # Horizontal line in about + + # Text colors + primary-text-color: '#FFFFFF' # Primary text colour, here is referencing dark-primary-color + text-primary-color: 'var(--primary-text-color)' # Primary text colour + secondary-text-color: '#5294E2' # For secondary titles in more info boxes etc. + disabled-text-color: '#7F848E' # Disabled text colour + label-badge-border-color: 'green' # Label badge border, just a reference value + + # Background colors + primary-background-color: '#383C45' # Settings background + secondary-background-color: '#383C45' # Main card UI background + divider-color: 'rgba(0, 0, 0, .12)' # Divider + + # Table rows + table-row-background-color: '#353840' # Table row + table-row-alternative-background-color: '#3E424B' # Table row alternative + + # Nav Menu + paper-listbox-color: 'var(--primary-color)' # Navigation menu selection hoover + paper-listbox-background-color: '#2E333A' # Navigation menu background + paper-grey-50: 'var(--primary-text-color)' + paper-grey-200: '#414A59' # Navigation menu selection + + # Paper card + paper-card-header-color: 'var(--accent-color)' # Card header text colour + paper-card-background-color: '#434954' # Card background colour + paper-dialog-background-color: '#434954' # Card dialog background colour + paper-item-icon-color: 'var(--primary-text-color)' # Icon color + paper-item-icon-active-color: '#F9C536' # Icon color active + paper-item-icon_-_color: 'green' + paper-item-selected_-_background-color: '#434954' # Popup item select + paper-tabs-selection-bar-color: 'green' + + # Labels + label-badge-red: 'var(--accent-color)' # References the brand colour label badge border + label-badge-text-color: 'var(--primary-text-color)' # Now same as label badge border but that's a matter of taste + label-badge-background-color: '#2E333A' # Same, but can also be set to transparent here + + # Switches + paper-toggle-button-checked-button-color: 'var(--accent-color)' + paper-toggle-button-checked-bar-color: 'var(--accent-color)' + paper-toggle-button-checked-ink-color: 'var(--accent-color)' + paper-toggle-button-unchecked-button-color: 'var(--disabled-text-color)' + paper-toggle-button-unchecked-bar-color: 'var(--disabled-text-color)' + paper-toggle-button-unchecked-ink-color: 'var(--disabled-text-color)' + + # Sliders + paper-slider-knob-color: 'var(--accent-color)' + paper-slider-knob-start-color: 'var(--accent-color)' + paper-slider-pin-color: 'var(--accent-color)' + paper-slider-active-color: 'var(--accent-color)' + paper-slider-container-color: 'linear-gradient(var(--primary-background-color), var(--secondary-background-color)) no-repeat' + paper-slider-secondary-color: 'var(--secondary-background-color)' + paper-slider-disabled-active-color: 'var(--disabled-text-color)' + paper-slider-disabled-secondary-color: 'var(--disabled-text-color)' + + # Google colors + google-red-500: '#E45E65' + google-green-500: '#39E949' + +carbon-green: + #Color List + make-light-carbon: "#93A5AB" + make-carbon: "#111924" + make-grey: "#DEE5E7" + make-green: "#C2DD08" + make-blue: "#00A3DA" + make-red: "#EC5D57" + make-yellow: "#FCF933" + make-orange: "#E49D64" + make-white: "#FFFFFF" + make-disable: "#bdbdbd" + light-primary-color: "var(make-light-carbon)" + background-color: "var(--make-grey)" + dark-primary-color: "var(-make-carbon)" + #Main Colors + primary-background-color: "var(--make-light-carbon)" #Background color settings + secondary-background-color: "var(--make-grey)" #Background tabs + primary-text-color: "var(--make-carbon)" #Primary Text + secondary-text-color: "var(--make-green)" #sub text etc. + disabled-text-color: "var(--make-disable)" #Deactivated Text + divider-color: "var(--make-green)" #Divider Linies + primary-color: "var(--make-carbon)" #Head of HA + #Labels + label-badge-red: "var(--make-red)" + label-badge-blue: "var(--make-blue)" + label-badge-green: "var(--make-green)" + label-badge-yellow: "var(--make-yellow)" + label-badge-grey: "var(--make-grey)" + label-badge-text-color: "var(--make-carbon)" #Text color sensors + label-badge-background-color: "var(--make-grey)" #Background sensors + #Google Loading + google-red-500: "var(--make-red)" + google-blue-500: "var(--make-blue)" + google-green-500: "var(--make-green)" + google-yellow-500: "var(--make-yellow)" + #Frontend + paper-green-400: "var(--make-green)" + paper-blue-400: "var(--make-blue)" + paper-orange-400: "var(--make-orange)" + paper-grey-50: "var(--make-grey)" + paper-grey-200: "var(--make-green)" + paper-item-icon-color: "var(--make-grey)" #Color Icon off + paper-item-icon-active-color: "var(--make-green)" #Color Icon on + paper-button-ink-color: "var(--make-carbon)" #Color Button selected + paper-button-color: "var(--make-red)" + paper-toggle-button-checked-ink-color: "var(--make-green)" + paper-toggle-button-checked-button-color: "var(--make-green)" + paper-toggle-button-checked-bar-color: "var(--make-green)" + paper-toggle-button-unchecked-button-color: "var(--make-grey)" + paper-toggle-button-unchecked-bar-color: "var(--make-grey)" + paper-toggle-button-unchecked-ink-color: "var(--make-grey)" + paper-slider-knob-color: "var(--make-carbon)" #Slider dot on + paper-slider-knob-start-color: "var(--make-carbon)" #Slider dot off + paper-slider-pin-color: "var(--make-red)" # + paper-slider-active-color: "var(--make-carbon)" #Slider line active + paper-slider-secondary-color: "var(--make-red)" # + paper-slider-container-color: "var(--make-light-carbon)" #Slider line inactive + paper-listbox-color: "var(--make-carbon)" #Text Dorpdown box + paper-listbox-background-color: "var(--make-grey)" #Background of Listen + paper-card-background-color: "var(--make-light-carbon)" #Background from cards in tabs + paper-card-header-color: "var(--make-carbon)" #Headline Color of tabs + paper-dialog-background-color: "var(--make-grey)" #Color Dialog Box + paper-item-selected_-_background-color: "var(--make-green)" #Selected Option in Dropdown + paper-tabs-selection-bar-color: "var(--make-red)" # + table-row-background-color: "var(--make-grey)" #Background color table + table-row-alternative-background-color: "var(--make-gery)" #second color table + #Font + primary-font-family: "Gill Sans" + paper-font-common-base_-_font-family: "var(--primary-font-family)" + paper-font-common-code_-_font-family: "var(--primary-font-family)" + paper-font-body1_-_font-family: "var(--primary-font-family)" + paper-font-subhead_-_font-family: "var(--primary-font-family)" + paper-font-headline_-_font-family: "var(--primary-font-family)" + paper-font-caption_-_font-family: "var(--primary-font-family)" + paper-font-title_-_font-family: "var(--primary-font-family)" diff --git a/www/ventilation.png b/www/ventilation.png new file mode 100644 index 0000000..fab0cdb --- /dev/null +++ b/www/ventilation.png Binary files differ