Hello everyone. I need to write the value of input_number to the table in Maria DB by pressing the input_button. I’m trying to do it through automation.
action:
- service: sql.query
data:
db_url: "mysql://homeassistant:homeassistant@core-mariadb/homeassistant?charset=utf8"
query: >-
INSERT INTO my_data (adding_time, my_data, my_number)
VALUES (
'{{ now().strftime("%Y-%m-%d %H:%M:%S") }}',
'{{ states('input_datetime.my_data') }}',
{{ states('input_number.my_number') | int }},
);
I get an error:
Error executing script. Service not found for call_service at pos 1: Action sql.query not found
Did I set something up wrong or does it not do this at all?