wills106 / homeassistant-solax-modbus

SolaX Power Modbus custom_component for Home Assistant (Supports some Ginlong Solis, Growatt, Sofar Solar, TIGO TSI & Qcells Q.Volt Hyb)
315 stars 98 forks source link

[FR] - Implement time, datetime etc #432

Open wawyed opened 1 year ago

wawyed commented 1 year ago

I just saw the new version released and might be useful to update to the new entity types for updating the charge discharge times on the Solis inverters at least. Might simplify things :)

https://www.home-assistant.io/blog/2023/06/07/release-20236/#new-entities-date-time-datetime

wills106 commented 1 year ago

I have made a start on the time branch https://github.com/wills106/homeassistant-solax-modbus/tree/time But I am struggling to understand how to implement it at the moment.

wawyed commented 1 year ago

Is it this one the one you are looking at ? https://www.home-assistant.io/integrations/input_datetime

wills106 commented 1 year ago

I was just going to implement the time entity https://developers.home-assistant.io/docs/core/entity/time I don't think we need any date support?

wawyed commented 1 year ago

You are probably right. The other one date is optional but I think it's for user creation not an integration.

wawyed commented 1 year ago

Did you manage to get it working in the end? @wills106

wills106 commented 1 year ago

Not yet, at the time there was only 2 Integrations supporting time and I didn't understand how they were getting it to work. I'll have another look to see if there is more info available now it's been out for a while.

SzosszeNET commented 7 months ago

I'm sure there are other important pieces, just wanted to bring to your attention that it appears that this project implemented time entries for charge discharge - https://github.com/Pho3niX90/solis_modbus

wawyed commented 6 months ago

is this something that'll ever get implemented? Just consider if it's worth moving to the other project for Solis or worth staying on this one?

wills106 commented 6 months ago

I have updated the time branch with newer code where at least the time entity loads. Even though it doesn't write anything at the min. I'm looking at setting up a Modbus simulator in docker for testing purposes. So I'm not restarting my live HA 1,000's of times and potentially writing something I shouldn't be doing to the Inverter.

Can't comment on any timeframes.

wills106 commented 4 months ago

If anyone knows what they are doing better than I do with python I have had another attempt.

https://github.com/wills106/homeassistant-solax-modbus/tree/time

time.py is based on select.py and time.2.py is based on number.py Neither return the value from "charger_start_time_1" need that working before progressing to writing the time.