项目作者: pasleto

项目描述 :
Home Assistant Lovelace Card for Apple iPhone X / XS / XR / 11 / 12
高级语言:
项目地址: git://github.com/pasleto/lovelace-iphone-xs-card.git
创建时间: 2020-05-23T19:52:54Z
项目社区:https://github.com/pasleto/lovelace-iphone-xs-card

开源协议:MIT License

下载



Lovelace Apple iPhone XS Card


HA Lovelace Card for Apple iPhone X / XS / XR / 11 / 12 using sensors data

Setup

Install using HACS using the following custom plugin repository https://github.com/pasleto/lovelace-iphone-xs-card

  1. resources:
  2. - url: /hacsfiles/lovelace-iphone-xs-card/lovelace-iphone-xs-card.js
  3. type: module

OR

Manually add content of dist folder to your <config>/www/lovelace-iphone-xs-card folder and add the following to your configuration.yaml file:

  1. resources:
  2. - url: /local/lovelace-iphone-xs-card/lovelace-iphone-xs-card.js
  3. type: module

Configuration

Build your merged phone sensor (example using Life360 & Icloud & HA App)
This is minimal (required) configuration for this card to function correctly:

  1. - platform: template
  2. sensors:
  3. tomas_iphone_xs:
  4. friendly_name_template: >-
  5. {{ state_attr('device_tracker.tomas_iphone', 'friendly_name') }}
  6. value_template: >-
  7. {{ states.device_tracker.tomas.state }}
  8. icon_template: mdi:cellphone-iphone
  9. attribute_templates:
  10. battery: >-
  11. {{ state_attr('device_tracker.tomas', 'battery') }}
  12. battery_charging: >-
  13. {% if state_attr('device_tracker.tomas', 'battery_charging') %}
  14. true
  15. {% else %}
  16. false
  17. {% endif %}
  18. battery_status: >-
  19. {{ state_attr('device_tracker.tomas_iphone_icloud_xs', 'battery_status') }}
  20. wifi_on: >-
  21. {% if state_attr('device_tracker.tomas', 'wifi_on') %}
  22. true
  23. {% else %}
  24. false
  25. {% endif %}
  26. entity_picture: >-
  27. {{ state_attr('device_tracker.tomas_iphone_nmap', 'entity_picture') }}
  28. ssid: >-
  29. {{ states.sensor.tomas_iphone_ssid.state }}
  30. sim_1: >-
  31. {{ states.sensor.tomas_iphone_sim_1.state }}
  32. sim_2: >-
  33. {% if states.sensor.tomas_iphone_sim_2.state is defined %}
  34. {{ states.sensor.tomas_iphone_sim_2.state }}
  35. {% else %}
  36. Not present
  37. {% endif %}
  38. device_type: >-
  39. {{ state_attr('device_tracker.tomas_iphone_icloud_xs', 'device_name') }}

Add to Lovelace:

  1. - type: custom:iphone-xs-card
  2. entity: sensor.your_phone_sensor
  3. showSim1: false # optional - default = true (hide Sim 1)
  4. showSim2: false # optional - default = true (hide Sim 2)
  5. showWifi: false # optional - default = true (hide Wi-Fi)
  6. showPlug: false # optional - default = true (hide charging animation)

BMC