Closed ahgray closed 2 years ago
Please properly format your YAML.
Think i figgured out how to format it, does it look ok now?
Please properly format your YAML.
This seems to resolve the issue. For anyone else or if you want to add to documentation/examples this is working.
Lovelace Buttons
cards:
- show_name: true
show_icon: true
type: button
hold_action:
action: call-service
service: script.add_diaper_change_from_select_options
entity: sensor.baby1_last_change
name: Change Diaper
icon: mdi:emoticon-poop
- show_name: true
show_icon: true
type: button
hold_action:
action: call-service
service: script.add_feeding_based_off_selected_options
entity: sensor.baby1_last_feeding
name: Add Feeding
icon: mdi:baby-bottle-outline
- show_name: true
show_icon: true
type: button
hold_action:
action: call-service
service: babybuddy.add_sleep
data:
timer: true
end: '00:00:00'
target:
entity_id: switch.baby1_timer
entity: sensor.baby1_last_sleep
name: Add Sleep
icon: mdi:cradle-outline
Feeding Script
service: babybuddy.add_feeding
data:
type: '{{states(''select.baby_buddy_feeding_type'')}}'
method: '{{states(''select.baby_buddy_feeding_method'')}}'
timer: true
target:
entity_id: switch.baby1_timer
I'm sure this is probably just my ignorance but, I have a template that doesn't seem to work when I call baby buddy services even though it appears to return the right value in developer tools. Could you tell me what I'm doing wrong, it would also be nice to see some documentation regarding using the select options like this. I've got other things like adding sleep using the time working well.
"{{states('select.baby_buddy_diaper_color')}}"
Returns Brown etc as per the selected value. However in this card setup with buttons it returns the following error.
Failed to call service babybuddy/add_diaper_change. value must be one of ['Black', 'Brown', 'Green', 'Yellow'] for dictionary value @ data['color']
Card Code