Problem with temperature sensing automation

I have this in my automation.yaml file:

- id: "Cold house"
  alias: 'Cold house'
  trigger:
    - platform: numeric_state
      entity_id: sensor.tankpi_temp
      below: 70
  action:
    - service: notify.email
      data:
        title: 'House cold'
        message: "House is cold! {{states('sensor.tankpi_temp') }}F"
    - service: notify.sms_matt
      data:
        title: 'House cold'
        message: "House is cold! {{states('sensor.tankpi_temp') }}F"

I triggers one time and sends the correct message. After a trigger my home-assistant.log file shows this entry if it tries to trigger again…

 ERROR (MainThread) [homeassistant.core] Invalid service data for automation.trigger: Entity ID cold house is an invalid entity id for dictionary value @ data['entity_id']. Got 'Cold house'

What is is trying to tell me?

Thanks Matt

What’s the state of: sensor.tankpi_temp
Also, if you have the history component loaded, what are some historic states of: sensor.tankpi_temp
Is it a integer, eg 70, or a decimal, eg 70.45

Also, if you throw “House is cold! {{states(‘sensor.tankpi_temp’) }}F” in the template editor, what does it return?

The state of sensor.tankpi_temp is a numeric value fixed at 1 decimal point.

In the template editor it returned… Error rendering template: TemplateSyntaxError: unexpected char ‘‘’ at 25

I changed the ticks to the one next to the enter key and it works!
“House is cold! {{states(‘sensor.tankpi_temp’) }}F”
“House is cold! 64.2F”

Thanks so much, now I also know that the template editor is!

I think I jumped the gun… it still appears not to like the ’ or `, what the heck.

Error with ’ used:

2017-11-14 11:44:20 ERROR (SyncWorker_6) [homeassistant.util.yaml] while parsing a block mapping
  in "/config/includes/automations.yaml", line 479, column 9
expected <block end>, but found '<scalar>'
  in "/config/includes/automations.yaml", line 480, column 44
2017-11-14 11:44:20 ERROR (MainThread) [homeassistant.components.automation] while parsing a block mapping
  in "/config/includes/automations.yaml", line 479, column 9
expected <block end>, but found '<scalar>'
  in "/config/includes/automations.yaml", line 480, column 44

Error with `:

2017-11-14 11:46:28 ERROR (MainThread) [homeassistant.core] Invalid service data for notify.email: invalid template (TemplateSyntaxError: unexpected char '`' at 24) for dictionary value @ data['message']. Got 'House is cold! {{states(`sensor.tankpi_temp`)}}F'
2017-11-14 11:46:28 ERROR (MainThread) [homeassistant.core] Invalid service data for notify.sms_matt: invalid template (TemplateSyntaxError: unexpected char '`' at 24) for dictionary value @ data['message']. Got 'House is cold! {{states(`sensor.tankpi_temp`)}}F'

Current code in automations:

- id: "Cold house"
  alias: 'Cold house'
  trigger:
    - platform: numeric_state
      entity_id: sensor.tankpi_temp
      below: 68
  action:
    - service: notify.email
      data:
        title: "House cold"
        message: 'House is cold! {{states(`sensor.tankpi_temp`)}}F'
#        message: "House is cold!  60F"
    - service: notify.sms_matt
      data:
        title: "House cold"
        message: "House is cold! {{states(`sensor.tankpi_temp`)}}F"
#        message: "House is cold!  60F"

The graph in the history section shows the correct value. And the state of the sensor shows a correct value.

Please keep in mind, I am very new to this…

When you are using template code, you need to use data_template instead of data.

try changing this from

    - service: notify.email
      data:
        title: "House cold"
        message: 'House is cold! {{states(`sensor.tankpi_temp`)}}F'
#        message: "House is cold!  60F"
    - service: notify.sms_matt
      data:
        title: "House cold"
        message: "House is cold! {{states(`sensor.tankpi_temp`)}}F"

To

    - service: notify.email
      data_template:
        title: "House cold"
        message: 'House is cold! {{states(`sensor.tankpi_temp`)}}F'
#        message: "House is cold!  60F"
    - service: notify.sms_matt
      data_template:
        title: "House cold"
        message: "House is cold! {{states(`sensor.tankpi_temp`)}}F"

Made the change and tried a trigger with “automation” “trigger”

{
"entity-id": "Cold house"
}

Got the following error:

2017-11-14 12:12:28 ERROR (MainThread) [homeassistant.core] Invalid service data for automation.trigger: extra keys not allowed @ data['entity-id']. Got 'Cold house'

I appreciate your help, beginning to wonder if this will work.

It is entity_id and not entity-id.

Adjusted the dash to an underscore and triggered with this logged error:

2017-11-14 12:17:38 ERROR (MainThread) [homeassistant.core] Invalid service data for automation.trigger: Entity ID cold house is an invalid entity id for dictionary value @ data['entity_id']. Got 'Cold house'

You need to get the entity_id from the states tab. What you have is probably the entity friendly_name. If you click on the hamburger icon on the top left, and under developer tools, you will find states tab that looks like < >. Click on that, you will be presented with a page that has all the entities.

I am not seeing the automation.Cold_house in my list of automations under the states listing…

That is were I got the ID, just checked again and it is sensor.tankpi_temp in blue.