Hangouts doesn't read sensors states

Hi, community!
I’m going to migrate from pushbullet to hangouts but have some trouble:
cant send states of sensors like:

{
  "message": [
    {
      "text": "T={{states.sensor.temperature_xxx.state}}°C, H={{states.sensor.humidity_xxx.state}}% Kchn: {{states.sensor.kitchen_smoke.state}},{{states.sensor.kitchen_leak.state}} Bath: {{states.sensor.bath_leak.state}}, WC: {{states.sensor.wc_leak.state}}, Air is {{states.binary_sensor.door_window_sensor_xxx.state}}, Lights is {{states.group.all_lights.state}}, Window is {{states.sensor.window.state}}, QNAP status is {{states.sensor.nas_status.state}}, CPU {{states.sensor.nas_cpu_usage.state}}%, RAM {{states.sensor.nas_memory_usage.state}}%"
    }
  ],
  "target": [
    {
      "id": "xxx"
    }
  ]
}

At PB I’ve got “T=20°C…” at hangouts - “T={{states.sensor.temperature_xxx.state}}°C…”

But

hangouts:
  intents:
    Report:
      sentences:
        - Send me a report
      conversations:
        - id: !secret hang_cid_alex

intent_script:
  Report:
    speech:
      text: T={{states.sensor.temperature_xxx.state}}°C...

works perfectly

How to solve it?

I use it like short report for amazfit bip via Tasker (push the button 3 times and get the report).

1 Like

Sounds like I have the same issue. Trying to send a message which includes a sensor value but I just get the text through

 "message": [
{
  "is_bold": "false",
  "text": "Hi Dave the print progress is {{ states.sensor.job_progress.state }}"
}

I have resolved this for my example, you need to use a data template. Thanks to @dshokouhi for their help and example. My working code is now:

  action:
  - service: hangouts.send_message
    data_template:
      message:
      - text: >
          Hi Dave the print progress is {{ states.sensor.job_progress.state }}
      target:
      - id: xxx

Similar code from my automations, which works fine every morning:

    - service: hangouts.send_message
      data_template: 
        target:
          - id: xxxxxxx
        message:
          - text: Today in my city it will be {{states('sensor.short_summary')}}, with the high of {{states('sensor.temperature_max')}} and a low of {{states('sensor.temperature_min')}} degrees celsius. A chance of rain is {{states('sensor.chance_of_any_rain')}}.

You are my Hero!

  alias: test message
  sequence:
  - data_template:
      message:
      - text: On the kitchen {{states('sensor.kitchen_smoke')}} now
      target:
      - id: aHugesEcreT
    service: hangouts.send_message

Works now.

Changed ‘data’ to ‘data_template’ and sensor state code. Perfect. Thanks :grinning: