Add sun support
To be changed later getting data from the blueprint
This commit is contained in:
@@ -5,6 +5,18 @@ substitutions:
|
|||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
|
|
||||||
api:
|
api:
|
||||||
|
id: api_server
|
||||||
|
services:
|
||||||
|
- service: set_float
|
||||||
|
variables:
|
||||||
|
component: string
|
||||||
|
val: float
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
if (!isnan(val)) {
|
||||||
|
if (component == "latitude") sun_entity->set_latitude(val);
|
||||||
|
else if (component == "longitude") sun_entity->set_longitude(val);
|
||||||
|
}
|
||||||
|
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- id: bs_vibrating
|
- id: bs_vibrating
|
||||||
@@ -205,6 +217,34 @@ select:
|
|||||||
disabled_by_default: false
|
disabled_by_default: false
|
||||||
icon: mdi:dip-switch
|
icon: mdi:dip-switch
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- id: sun_elevation
|
||||||
|
name: Sun Elevation
|
||||||
|
platform: sun
|
||||||
|
type: elevation
|
||||||
|
internal: true
|
||||||
|
|
||||||
|
- id: zone_home_latitude
|
||||||
|
platform: homeassistant
|
||||||
|
entity_id: zone.home
|
||||||
|
attribute: latitude
|
||||||
|
internal: false
|
||||||
|
on_value:
|
||||||
|
- lambda: if (!isnan(x)) sun_entity->set_latitude(x);
|
||||||
|
|
||||||
|
- id: zone_home_longitude
|
||||||
|
platform: homeassistant
|
||||||
|
entity_id: zone.home
|
||||||
|
attribute: longitude
|
||||||
|
internal: false
|
||||||
|
on_value:
|
||||||
|
- lambda: if (!isnan(x)) sun_entity->set_longitude(x);
|
||||||
|
|
||||||
|
sun:
|
||||||
|
id: sun_entity
|
||||||
|
latitude: 90
|
||||||
|
longitude: 180
|
||||||
|
|
||||||
switch:
|
switch:
|
||||||
- id: sw_speaker_aplifier
|
- id: sw_speaker_aplifier
|
||||||
name: Speaker - Aplifier
|
name: Speaker - Aplifier
|
||||||
@@ -277,6 +317,10 @@ text_sensor:
|
|||||||
lambda: |-
|
lambda: |-
|
||||||
return {"${version}"};
|
return {"${version}"};
|
||||||
|
|
||||||
|
time:
|
||||||
|
- id: time_source
|
||||||
|
platform: homeassistant
|
||||||
|
|
||||||
uart:
|
uart:
|
||||||
id: if_uart_touch
|
id: if_uart_touch
|
||||||
tx_pin: GPIO19
|
tx_pin: GPIO19
|
||||||
|
|||||||
Reference in New Issue
Block a user