custom-components / pyscript

Pyscript adds rich Python scripting to HASS
Apache License 2.0
874 stars 46 forks source link

Service call to Input_datetime not working #543

Open sjs-1956 opened 10 months ago

sjs-1956 commented 10 months ago

I have a time helper entity set up. I want to change the time in the pyscript code. I've tried calling the service as below;

input.datetime.battery_charge_start.set_datetime(time="08:01:00") service.call("input_datetime", "set_datetime", entity_id="input.datetime.battery_charge_start", time="08:01:00") input_datetime.set_datetime(entity_id="input.datetime.battery_charge_start", time="08:01:00")

Neither work. However for another helper, this works;

input_number.set_value(entity_id="input_number.battery_monitor_start_secs", value=34)

I need a little help please.

JohannCR commented 8 months ago

Had the same problem. After quite a few tries, found out how it works (no info in the docs).

ALERTua commented 8 months ago

Here's the cure for you: https://github.com/dmamelin/pyscript_autocomplete

JohannCR commented 8 months ago

Interesting... A bit convoluted to use, but definitely useful I'll give it a try thanks !