#Set a time via "time" integration and REST API

1 messages · Page 1 of 1 (latest)

thorn jetty
#

Hi, I want to modify the start time for my heat pump and this works fine via node red companion. E.g. I can modify the start time via developer tools like this without problem:

action: time.set_value
target:
entity_id: time.watertimeon_waterkotte
data:
time: "07:13:21"

But if I want to change the start time via REST API I always get a 400 - Bad Request. I have tried it like this:

curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" http://$HA_IP:8123/api/services/time/set_time -d '{"entity_id":"time.watertimeon_waterkotte","time":"07:23:00"}'
400: Bad Request
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" http://$HA_IP:8123/api/services/time/set_time -d '{"target":{"entity_id":"time.watertimeon_waterkotte"},"data":{"time":"07:23:00"}}'
400: Bad Request

According to this documentation I need to set entity_id and time https://www.home-assistant.io/integrations/time ... how does the json string need to look like? Can anyone give me clue? Many thanks in advance!

Home Assistant

Instructions on how to set up time entities within Home Assistant.