Comments (15)
I finally made two shell scripts to be integrated to HA
setdate.sh
#!/bin/zsh
user="USER"
password="PWD"
serial="SN"
rm -f cookie.txt
payload="{ \"smartphoneId\": \"pymultiMATIC\", \"username\": \"$user\", \"password\": \"$password\" }"
token=`curl -c cookie.txt -s -X POST -H "Content-Type:application/json" -H "Accept:application/json" -d $payload 'https://smart.vaillant.com/mobile/api/v4/account/authentication/v1/token/new' | jq '.body.authToken'`
payload="{ \"smartphoneId\": \"pymultiMATIC\", \"username\": \"$user\", \"authToken\": $token }"
curl -b cookie.txt -c cookie.txt -X POST -H "Content-Type:application/json" -H "Accept:application/json" -d $payload "https://smart.vaillant.com/mobile/api/v4/account/authentication/v1/authenticate"
payload="{ \"datetime\": \"`date +\"%FT%T.000Z\"`\"}"
#payload="{ \"datetime\": \"2021-06-08T18:00:00.000Z\"}"
url="https://smart.vaillant.com/mobile/api/v4/facilities/$serial/systemcontrol/v1/status/datetime"
curl -b cookie.txt -c cookie.txt -X PUT -H "Content-Type:application/json" -H "Accept:application/json" -d $payload $url
rm -f cookie.txt
and
getdate.sh
#!/bin/sh
user="USER"
password="PWD"
serial="SN"
rm -f cookie.txt
token=`curl -s -c cookie.txt -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{ "smartphoneId": "pymultiMATIC", "username": "'${user}'", "password": "'${password}'" }' 'https://smart.vaillant.com/mobile/api/v4/account/authentication/v1/token/new' | jq '.body.authToken'`
curl -s -b cookie.txt -c cookie.txt -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{ "smartphoneId": "pymultiMATIC", "username": "'${user}'", "authToken": '${token}' }' 'https://smart.vaillant.com/mobile/api/v4/account/authentication/v1/authenticate'
datetime=`curl -s -b cookie.txt -c cookie.txt -X GET -H 'Content-Type:application/json' -H 'Accept:application/json' 'https://smart.vaillant.com/mobile/api/v4/facilities/'${serial}'/systemcontrol/v1/status' | jq '.body.datetime'`
echo ${datetime}
rm -f cookie.txt
from vaillant-component.
Hello,
to me, this is the same kind of config that should not be included in the integration, this is not directly related to the platform used by the integration (fan, climate, water_heater, etc).
Maybe another option would be to create a script and the trigger it when you want via an automation ?
from vaillant-component.
There is already a service 'multimatic.request_hvac_update'. Why isn't it possible to add something like 'multimatic.set_date_time' service? BTW, I don't even know if such API call exists.
Of course it will be called manually or by some trigger.
from vaillant-component.
request_hvac_update
is needed in some case to refresh data (some users reported their data were not getting updated).
From technical point of view, there is no problem adding a set_date_time service, this is more a scope problem. I don't want to add every single configuration possibilities available in the app or on the VRC700 (also, my end goal is to have the integration included in HA core, and I'm quite sure this kind of service won't pass the code review), this is why I proposed you to have a small script to the datetime and triggered it via automation
from vaillant-component.
Thomas, got it. I'm fine to use the script to set the date/time. Can you please share such script?
from vaillant-component.
I don't have a script right now, but I could do that
from vaillant-component.
It would be great! Looking forward to get it!
As for making this a general feature of the component, without NTP-like date/time setting the whole Vaillant hardware is more or less useless, because the time schedule only works if date/time is properly set. So, one can that this is an essential feature for your component. I believe it will be accepted by HA core team.
This feature, e.g. automatic update of date/time, could be deeply integrated into component and could be turned on/off via component option.
from vaillant-component.
Hi, Thomas,
I played a little bit with Vaillant API using pymultiMATIC as a source of information. I found only one place with facility date/time information here https://smart.vaillant.com/mobile/api/v4/facilities/_serialNumber_/system/v1/details
. In my case the response is like this:
"body":{
"facilityDetails":{
"facilityName": "NAME",
"facilityTime": "2021-06-08T19:49:35.986Z",
"facilityTimeZone": "Europe/Moscow"
}
},
"meta":{}
But facilities_details() is not reference anywhere in the code. So, it was not clear for me, if it is possible to modify facilityTime
.
I tried PUT method with https://smart.vaillant.com/mobile/api/v4/facilities/_serialNumber_/system/v1/details
with this payload:
{
"facilityName": "NAME",
"facilityTime": "2021-06-07T19:00:00.000Z",
"facilityTimeZone": "Europe/Moscow"
}
It doesn't work. The response is HTTP Status 405 – Method Not Allowed
.
I also found that date/time information is available here: https://smart.vaillant.com/mobile/api/v4/facilities/_serialNumber_/systemcontrol/v1/status. Here is the response:
"body":{
"datetime": "2021-06-08T20:22:28.000Z",
"outside_temperature": 19.4
}
But it is also not possible to set this datetime.
from vaillant-component.
I have finally found the right endpoint:
https://smart.vaillant.com/mobile/api/v4/facilities/_serialNumber_/systemcontrol/v1/status/datetime
PUT method works here with this payload
{
"datetime": "2021-06-08T18:00:00.000Z"
}
I will now try to write Python script.
from vaillant-component.
can I close the issue ?
from vaillant-component.
Yes!
from vaillant-component.
Hi, Thomas,
Let me come back to this issue. Recently I've updated multimatic component to 1.7.1. And now I see a lot of errors likes this:
2021-08-18 11:34:27 ERROR (MainThread) [custom_components.multimatic.coordinator] Unexpected error fetching multimatic_quick_mode data: Unable to authenticate at https://smart.vaillant.com/mobile/api/v4/account/authentication/v1/authenticate
I'm pretty sure that this is because my get/set date scripts interfere with multimatic component. Both scripts and component use the same login/password to login/authenticate. get_time script is executed every 5 minutes. And as far as I understand, it destroys multimatic component session/token.
What is the best way to overcome this problem? New user?
What if you reconsider adding get/set datatime service to your component?
from vaillant-component.
Hmm yeah, strange that it appears with 1.7.1, this is a minor change.
As you said, you could use a seperate user in order to avoid authentication issues.
from vaillant-component.
Thomas, I have migrated from 1.5.0 to 1.7.1. It was a big update for me ;) So, no worries.
from vaillant-component.
@smmoroz I'm having the same problem with time being reset. I've tried your script but doesn't work anymore. I'm getting {"errorCode":"INVALID_PARAMS"} on last call, when getting the time.
from vaillant-component.
Related Issues (20)
- VRC720 and VR92 heating displayed as cooling HOT 3
- Gas consumption doesn't match in the sensoApp and HA HOT 3
- Configurable zone quick veto duration HOT 2
- change of Vaillant user & password HOT 1
- Indoor Sensor HOT 2
- Missing outdoor temperature HOT 1
- Duplicate entities added after Home Assistant reboot HOT 1
- Upcoming deactivation from sensoApp, multiMATIC HOT 32
- Unable to set_ventilation_day_level HOT 2
- Newbie problem: can't find the UI ... HOT 3
- Setting energy consumption in HA - which values? HOT 1
- HotWater TargetTemp VRC700/4 VR921
- Quick Mode is not in list
- Accessing climate zone entities
- Vaillant integration is not fully working after new vaillant upgrade to new application "Myvaillant" HOT 10
- Entities show warning in logs. HOT 1
- Failed to call service climate/set temperature
- Failing autentication after vaillant update HOT 5
- Error: 403, message='Forbidden' HOT 1
- MultiMatic app end-of-life. Is successor myVAILLANT-app compliant with your vaillant-component? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vaillant-component.