Lovelace -problems

I liked the UK channel zone too though. Unless you visit that place frequently.

Here’s an example of an automation that executes multiple actions:

OK thanks, that makes sense.
the config check says I can also do this:-


   action:
      service: homeassistant.turn_off
      entity_id: automation.shack_supply_on 
      entity_id: switch.hot_water_boiler

I just copied and pasted to see if the config checker would accept i, but it means I can deactivate and re-activate several automations with two scripts, useful learning curve
thanks

It’s less confusing if you write it like this:

action:
  service: homeassistant.turn_off 
  entity_id: 
    - automation.shack_supply_on 
    - switch.hot_water_boiler

Since that is the way you will see it written in the vast majority of examples on the forum and in the docs. As a matter of fact, I’ve never seen it written that way so if you would have asked if it was legal syntax I would have been sure that the answer was no.

The other thing I’d say is, just because the config check recognizes it as valid YAML doesn’t mean it will work. I’d definitely recommend testing to make sure it does what you expect before you actually go out of town, @richard-g8jvm.

Hi
I’ll make sure I test everything before hand., thanks for the syntax correction Finity.
I’ve been think of you boolean approach to an away flag, and been reading thru the docs,.
but so far not found the relevant section to set the flag with a “button” or what ever its called in lovelace. could you point me in the right direction please.
Richard

Create an entity button. Point to your Boolean.

You can add it to an entities card or create an entity_button card for it:


Do you have to create the entity on configurations.yaml, in the UI its only listing existing entities

Yes, see below:

If you want a manually configured input Boolean, you have to create it. Home assistant doesn’t know what you want to create…

Thanks both
back in to reading mode

Two Boolean state s added to a glance one for vacation the other for day trips
I’ve been playing with history graphs directly from lovelace UI config
The graph on the History card page looks nice, scale on the Y axis in 2 degree lines
Mine looks horrible with 10 degree lines.

type: history-graph
gr1: null
entities:
  - sensor.hot_water_temp
unit_of_measurement: C

how do I make it look pretty ?
think of adding cloud_cover as well, would that put the Y scale for that on the RHS

Thanks

Another question with the UI and history graphs
I 'd like to plot sun elevation so I can see the correlation between the angle of the sun above the horizon , and the hot water temp, which is part powered from PV panels

How do I get the data to the graph. its already used as a condition with

value_template: '{{ states.sun.sun.attributes.elevation < 15 }}'


for the graph config I have

entities:
  - sensor.hot_water_temp
### would this be correct:-
  -  states.sun.sun.attributes.elevation
##   or
 -  sun.sun.attributes.elevation

thanks
Richard

I could be wrong but I don’t think you can graph attributes. It doesn’t mention that in the docs for the history graph.

you will probably have to create a template sensor that extracts the elevation out of the entity and then use that in the history graph.

Thanks Finity
I tried all the combinations I could think of but nothing worked.

I guess it would be to filter the attribute with the value template , which I’m using elsewhere and
pipe that to a dummy sensor.
The pipe symbol in linux “|” is used in HA as filter is it the same function which just a different name.
more reading

sensor:
  - platform: template
    sensors:
      sun_elevation:
        friendly_name: sun elevation
        entity_id: sensor.time
        value_template: "{{state_attr('sun.sun', 'elevation') }}"

that will create a sensor called “sensor.sun_elevation” that will update every minute and you can use that directly in the history graph. You will have to make sure you have the time sensor configured tho.

Many thanks Finity

I was trying with

 - platform: template
    sensors:
    sun_elevation:
    friendly_name: "Sun Elevation"
    unit_of_measurement: "deg"
    entity_id: sensor.sun_elevation
    icon_template: sun
    value_template: '{{ states.sun.sun.attributes.elevation}}'

but that was retuning invalid config.
Yours works and shows the elevation as a bar
I’ve added “unit_of_measurement: “degs”” to configuration.yaml , it nows shows as a graph

Adding “hours_to_show” on the card config

type: history-graph
entities:
  - sensor.hot_water_temp
  - sensor.sun_elevation
hours_to_show: 12

still shows as


A lot of progress thanks
Richard

Still getting a minor problem , the history graph is not updating
its showing hot water temperature, and that sensor is sending updates every minute
also sun elevation.
if for the UI I select “configure UI” the graph is updated
card config:-

type: history-graph
hours_to_show: 12
update_interval: 1
entities:
  - entity: sensor.hot_water_temp
  - entity: sensor.sun_elevation

automatiion.yaml:-

 - alias: Time tick
    trigger:
      platform: time_pattern
      minutes: '/1'
    action:
      service: homeassistant.update_entity
      entity_id: sensor.hot_water_temp  <<<<< has also been tried on sensor.sun_elevation

on the sun elevation , Finity’s script

 - platform: template
    sensors:
      sun_elevation:
        friendly_name: Sun Elevation
        unit_of_measurement: "deg"
        entity_id: sensor.time
#        entity_id: sensor.sun_elevation
        value_template: "{{state_attr('sun.sun', 'elevation') | round(1) }}"

The entity sensor.sun_evelation shows in Developer tools >events, but sensor.time does not.

I though the 1 minute tick automation to update the sensor info might work , but not.
Looking in developer tools >events I can see the attributes for sun_elevation are not updating from the sun.sun attributes

Reading thru the topics I can see a lot of graphs not updating , but haven’t found a solution in my case.
current HA version is 0.91.2
Finity you said

You will have to make sure you have the time sensor configured tho.

Looks like I screwed that up somehow.
thanks
Richard

Think I’ve found it

type: history-graph
hours_to_show: 12
update_interval: 1  <<<<<<<<< needs to be refresh_interval: 1
entities:
  - entity: sensor.hot_water_temp
  - entity: sensor.sun_elevation