This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| projects:internetofthings:esphome [2021/02/26 06:19] – [ESPHOME] scipio | projects:internetofthings:esphome [2021/07/06 07:26] (current) – [ESP32 cam] scipio | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== ESPHOME ====== | ====== ESPHOME ====== | ||
| + | ===== ESP32 cam ===== | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | |||
| + | |||
| + | <code bash> | ||
| + | #!/bin/sh | ||
| + | |||
| + | TOKEN=... | ||
| + | |||
| + | PAYLOAD=" | ||
| + | |||
| + | |||
| + | curl -q -X POST \ | ||
| + | -d " | ||
| + | -H " | ||
| + | -H " | ||
| + | http:// | ||
| + | </ | ||
| + | |||
| + | in esp32 cam this section is missing in " | ||
| + | <code javascript> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | ] | ||
| + | } | ||
| + | ] | ||
| + | }, | ||
| + | </ | ||
| + | |||
| + | esp32 entry (missing some values) | ||
| + | |||
| + | <code javascript> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | valid stream camera working in alexa | ||
| + | <code javascript> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | ] | ||
| + | } | ||
| + | ] | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | |||
| + | </ | ||
| ===== BLE tracker smartband ===== | ===== BLE tracker smartband ===== | ||
| Line 64: | Line 227: | ||
| ===== BLE bluetooth tracker (version 1) ===== | ===== BLE bluetooth tracker (version 1) ===== | ||
| - | hass | + | hass input_boolean: |
| <code yaml> | <code yaml> | ||
| - | input_boolean: | + | beacon2_learn: |
| - | | + | name: learn beacon2 |
| - | | + | initial: off |
| - | initial: off | + | icon: mdi:mdi-tag-plus |
| - | icon: mdi:alarm-plus | + | |
| - | beacon1: | + | beacon2_active: |
| - | name: learn beacon1 | + | name: beacon2 is recently seen |
| - | | + | icon: mdi:mdi-account-check |
| - | | + | |
| - | beacon2: | + | beacon2_trigger: |
| - | name: learn beacon2 | + | name: beacon2 |
| - | initial: off | + | initial: off |
| - | icon: mdi:mdi-tag-plus | + | icon: mdi:mdi-account-check |
| + | </ | ||
| - | beacon1_active: | + | hass input_text: |
| - | | + | < |
| - | icon: mdi: | + | beacon1: |
| + | name: BLE beacon1 | ||
| - | beacon2_active: | + | beacon2: |
| - | name: beacon2 | + | name: BLE beacon2 |
| - | icon: mdi: | + | </ |
| - | input_text: | + | hass scripts: |
| - | | + | < |
| - | | + | set_ibeacon: |
| - | | + | |
| - | | + | |
| - | | + | |
| + | | ||
| + | data_template: | ||
| + | ibeacon: "{{ ibeacon }}" | ||
| + | | ||
| + | data_template: | ||
| + | ibeacon: "{{ ibeacon }}" | ||
| - | scripts: | + | set_beacon2: |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | - service: script.set_beacon1 | + | - condition: state |
| - | | + | |
| - | | + | state: "on" |
| - | - service: | + | - service: |
| - | data_template: | + | data_template: |
| - | | + | |
| + | value: "{{ ibeacon }}" | ||
| + | - service: input_boolean.turn_off | ||
| + | entity_id: input_boolean.beacon2_learn | ||
| - | set_beacon1: | + | beacon2_active: |
| - | sequence: | + | sequence: |
| - | - service: script.beacon1_active | + | - condition: template |
| - | | + | |
| - | ibeacon: "{{ ibeacon }}" | + | - service: input_boolean.turn_on |
| - | - condition: state | + | entity_id: |
| - | entity_id: input_boolean.beacon1 | + | - delay: 1 |
| - | state: " | + | - service: input_boolean.turn_off |
| - | | + | entity_id: input_boolean.beacon2_trigger |
| - | data_template: | + | |
| - | | + | |
| - | value: "{{ ibeacon }}" | + | |
| - | - service: input_boolean.turn_off | + | |
| - | entity_id: input_boolean.beacon1 | + | |
| - | set_beacon2: | ||
| - | sequence: | ||
| - | - service: script.beacon2_active | ||
| - | data_template: | ||
| - | ibeacon: "{{ ibeacon }}" | ||
| - | - condition: state | ||
| - | entity_id: input_boolean.beacon2 | ||
| - | state: " | ||
| - | - service: input_text.set_value | ||
| - | data_template: | ||
| - | entity_id: input_text.beacon2 | ||
| - | value: "{{ ibeacon }}" | ||
| - | - service: input_boolean.turn_off | ||
| - | entity_id: input_boolean.beacon2 | ||
| - | beacon1_active: | + | </ |
| - | sequence: | + | |
| - | - condition: template | + | |
| - | value_template: | + | |
| - | - service: input_boolean.turn_on | + | |
| - | entity_id: input_boolean.beacon1_active | + | |
| - | - delay: 30 | + | |
| - | - service: input_boolean.turn_off | + | |
| - | entity_id: input_boolean.beacon1_active | + | |
| - | beacon2_active: | ||
| - | sequence: | ||
| - | - condition: template | ||
| - | value_template: | ||
| - | - service: input_boolean.turn_on | ||
| - | entity_id: input_boolean.beacon2_active | ||
| - | - delay: 30 | ||
| - | - service: input_boolean.turn_off | ||
| - | entity_id: input_boolean.beacon2_active | ||
| | | ||
| - | + | hass automations: | |
| - | automations: | + | < |
| - | - alias: " | + | - alias: " |
| - | trigger: | + | trigger: |
| - | platform: state | + | platform: state |
| + | entity_id: input_sensor.beacon2_trigger | ||
| + | to: " | ||
| + | condition: | ||
| + | condition: state | ||
| + | entity_id: input_boolean.beacon2_active | ||
| + | state: " | ||
| + | action: | ||
| + | - service: input_boolean.turn_on | ||
| entity_id: input_boolean.beacon2_active | entity_id: input_boolean.beacon2_active | ||
| - | to: " | + | |
| - | action: | + | data: |
| - | | + | message: " |
| data: | data: | ||
| - | | + | type: announce |
| - | data: | + | method: all |
| - | | + | target: |
| - | method: all | + | - show |
| - | target: | + | - Echo |
| - | - show | + | |
| - | - Echo | + | |
| - | | + | - alias: " |
| - | trigger: | + | trigger: |
| - | platform: state | + | platform: state |
| + | entity_id: input_boolean.beacon2_trigger | ||
| + | to: " | ||
| + | for: 140 | ||
| + | action: | ||
| + | - service: input_boolean.turn_off | ||
| entity_id: input_boolean.beacon2_active | entity_id: input_boolean.beacon2_active | ||
| - | to: " | + | - service: notify.alexa_media |
| - | | + | |
| - | | + | |
| - | action: | + | |
| - | - service: notify.alexa_media | + | |
| data: | data: | ||
| - | | + | type: announce |
| - | data: | + | method: all |
| - | | + | |
| - | method: all | + | |
| - | target: | + | |
| - | - show | + | |
| - | - Echo | + | |
| - | + | ||
| - | - alias: " | + | |
| - | trigger: | + | |
| - | platform: state | + | |
| - | entity_id: input_boolean.beacon1_active | + | |
| - | to: " | + | |
| - | action: | + | |
| - | - service: light.turn_on | + | |
| target: | target: | ||
| - | | + | - show |
| - | + | - Echo | |
| - | + | ||
| - | | + | |
| - | | + | |
| - | platform: state | + | |
| - | entity_id: input_boolean.beacon1_active | + | |
| - | to: " | + | |
| - | for: | + | |
| - | minutes: 1 | + | |
| - | action: | + | |
| - | | + | |
| - | target: | + | |
| - | entity_id: light.ikea_of_sweden_tradfri_bulb_e27_ws_opal_980lm_c969e5fe_level_light_color_on_off | + | |
| </ | </ | ||
| Line 225: | Line 344: | ||
| type: entities | type: entities | ||
| entities: | entities: | ||
| - | - entity: input_boolean.beacon1 | + | - entity: input_boolean.beacon2_learn |
| - | - entity: input_text.beacon1 | + | - entity: input_text.beacon2 |
| - | - entity: | + | - entity: |
| - | - entity: input_boolean.beacon1_active | + | - entity: input_boolean.beacon2_active |
| - | - entity: >- | + | title: Tracker |
| - | light.ikea_of_sweden_tradfri_bulb_e27_ws_opal_980lm_c969e5fe_level_light_color_on_off | + | |
| - | title: Tracker | + | |
| </ | </ | ||