-
Notifications
You must be signed in to change notification settings - Fork 3
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
Charging start/end time is not correct #6
Comments
I‘ll figure something out. I did it some time ago, but a lot has changed. I also don‘t have that config anymore. |
You might want to have a look at the swap option from homeassistant. There are a few options, but I don‘t know if the needed one is there. |
Ok, thanks a lot. I will update the wiki and put it out of beta. |
Working mode is input_type: holding pull request
- name: Working mode
unique_id: wb1_working_mode
slave: !secret wallbox_modbus_slave
address: 21262 # reg 21263
input_type: holding #input
data_type: uint16
scan_interval: 600
- name: Mileage per kWh
unique_id: wb1_mile_per_kwh
slave: !secret wallbox_modbus_slave
address: 21231 # reg 21232
input_type: holding #input
data_type: uint16
scan_interval: 10 |
I have created a new pull request with some fixes and a new template. |
It doesn't look like that exists, at least not in the official documentation. |
Not really - maybe an automation for each scenario is needed, can one also modbusscan with modbus-cli [0-248]? |
Wrong datetime (as_local): pull request
template:
- sensor:
- name: Charging start time
unique_id: wb1_charging_start_time
state: >
{{ as_local(as_datetime(states.sensor.charging_start_time_raw.state)).strftime("%d.%m.%Y %H:%M") }}
- name: Charging end time
unique_id: wb1_charging_end_time
state: >
{{ as_local(as_datetime(states.sensor.charging_end_time_raw.state)).strftime("%d.%m.%Y %H:%M") }}
needs to be changed to
template:
- sensor:
- name: Charging start time
unique_id: wb1_charging_start_time
state: >
{{ (as_datetime(states.sensor.charging_start_time_raw.state)).strftime("%d.%m.%Y %H:%M") }}
- name: Charging end time
unique_id: wb1_charging_end_time
state: >
{{ (as_datetime(states.sensor.charging_end_time_raw.state)).strftime("%d.%m.%Y %H:%M") }}
|
Without the as_local, it is in utc0. I am in utc+1 and wanted it shown like in the iCloudSolar app. Whats your timezone in HA? |
Weird. Timezone on HA is gmt+01:00 Berlin. Using as_local caused right timestamp +1 hour :) |
The values I get for "Charging start time" and "Charging end time" are not correct:
![image](https://private-user-images.githubusercontent.com/153714968/303008850-b3f64a59-5c2b-491a-97a3-158ad39a1f3b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1ODU2MjUsIm5iZiI6MTcyMDU4NTMyNSwicGF0aCI6Ii8xNTM3MTQ5NjgvMzAzMDA4ODUwLWIzZjY0YTU5LTVjMmItNDkxYS05N2EzLTE1OGFkMzlhMWYzYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxMFQwNDIyMDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NDRhMTRmZjVlMmM2YTMxMDRkZmZkZDc3YjQ1MTRmMjMzNTI3MTM0ZDNkZGU3YWNhNDViZDBkMTRlN2M4MGI1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.t6rcHwQ45yP4iWRI_s2ETEsdtfV8j8mDWvmEYyD61vc)
![image](https://private-user-images.githubusercontent.com/153714968/303008796-fca289c1-cade-41d1-8cea-5d3199bca66f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1ODU2MjUsIm5iZiI6MTcyMDU4NTMyNSwicGF0aCI6Ii8xNTM3MTQ5NjgvMzAzMDA4Nzk2LWZjYTI4OWMxLWNhZGUtNDFkMS04Y2VhLTVkMzE5OWJjYTY2Zi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxMFQwNDIyMDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hMTYzYjg5MGZjYmEzMjYzZjM3ZjAxNDQ2ZmEwNjgxYTk3ZjE2MWI4ZmExYjc2YzgwNDQ5NDhmMzc4MTU2Yzk2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.ZptAfg0CUJ_27rxurkqReOGsVMsPgZ2ZcoSsgdhgJHs)
I tried to get the correct values with modbus-cli and was successful with the following:
modbus dongle:502 -s 3 i@21319/I --byte-order=mixed
Parsed 0 registers definitions from 1 files
21319: 1707007290 0x65bedd3a
modbus dongle:502 -s 3 i@21317/I --byte-order=mixed
Parsed 0 registers definitions from 1 files
21317: 1706937153 0x65bdcb41
Those values are UNIX timestamps and could be converted to date/time. Unfortunately, I dont know how to configure the "--byte-order=mixed" option in HA yaml. Do you know how to do that?
Thanks & regards
Sunny
The text was updated successfully, but these errors were encountered: