#Want to send push messages from devices with device name
1 messages Β· Page 1 of 1 (latest)
You'll need to use a template. Something like {{ state_attr(trigger.to_state.entity_id, 'friendly_name') }} in the message.
Hi π
Something like
Damn im not good at this π
alias: Test vand sensor
description: ""
triggers:
- type: moist
device_id: dd852ab5c133e7e96d45165afedfc079
entity_id: 753dbcc6f6f36e2498edf7fe6dd642cc
domain: binary_sensor
trigger: device - type: moist
device_id: aada74b15891636ecd27c7cb0d1d8674
entity_id: dff7d5ed298a9cece61a670521c7405c
domain: binary_sensor
trigger: device
conditions: []
actions: - action: notify.send_message
title: "{{ state_attr(trigger.event.data.entity_id, 'friendly_name') }}"
metadata: {}
data: {}
mode: single
That dosent work
Hmm either this
actions:
- action: notify.send_message
metadata: {}
data:
message: title: "{{ state_attr(trigger.event.data.entity_id, 'friendly_name') }}"
mode: single
Ah, you're using device triggers. If you use entity triggers then putting the template in the message should work.
Hmm i get
string value is None for dictionary value @ data['message']
With
``alias: Test vand
description: ""
triggers:
- type: moist
device_id: aada74b15891636ecd27c7cb0d1d8674
entity_id: dff7d5ed298a9cece61a670521c7405c
domain: binary_sensor
trigger: device
conditions: []
actions: - action: notify.mobile_app_daniels_s24
metadata: {}
data:
message: null
mode: single
``
huh? I removed my {{ state_attr(trigger.to_state.entity_id, 'friendly_name') }} in the message ?
To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.
{{ state_attr(trigger.to_state.entity_id, 'friendly_name') }}
You need to use three of them around the big blocks π
Ahhh ddd
Okay the "message" should that contain " {{ state_attr(trigger.to_state.entity_id, 'friendly_name') }}" ? π
Yes, but you're still using a device trigger, not an entity trigger π
Not sure what the diffrence is? It seems pretty complex to use a entity?
Entities are actually much simpler. For example, I have a Netatmo climate sensor next to me. It's one device, but it has a temperature sensor, humidity sensor, CO2 sensor, and even a volume sensor. Each of those sensors are 1 entity.
Okay π But i cant find "is wet" now?
Sorry for the danish langugage π
Ouh sorry have to go to bed π
Any good ideas to get this to sende a message? π