Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service call to Input_datetime not working #543

Open
sjs-1956 opened this issue Nov 12, 2023 · 3 comments
Open

Service call to Input_datetime not working #543

sjs-1956 opened this issue Nov 12, 2023 · 3 comments

Comments

@sjs-1956
Copy link

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
Copy link

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

  • First, you have a typo. Change entity_id="input.datetime.battery_charge_start" into entity_id="input_datetime.battery_charge_start"

  • Second, for those looking to set a date or a datetime, use set_datetime(entity_id=xx, date=xx) or set_datetime(entity_id=xx, datetime=xx) accordingly

@ALERTua
Copy link
Contributor

ALERTua commented Jan 28, 2024

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

@JohannCR
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants