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

vicare services don't work #25

Closed
adorobis opened this issue Feb 3, 2020 · 43 comments
Closed

vicare services don't work #25

adorobis opened this issue Feb 3, 2020 · 43 comments

Comments

@adorobis
Copy link
Contributor

adorobis commented Feb 3, 2020

I have configured the integration for my viessmann heater, it correctly displays attributes from my heater but I can't set any parameters (neither water heater temperature nor preset_modes. There are no relevant entries in the log that would explain what's happening. How can I troubleshoot the issue further?

@oischinger
Copy link
Owner

Does setting the parameters work in the app?

@adorobis
Copy link
Contributor Author

adorobis commented Feb 3, 2020

Apparently not, there is no such option (also confirmed by viessmann support). I'll try to check the PyViCare API to see if it is supported there. But setting the target temperature for water heater works on the ViCare app but don't work by calling the Home Assistant service. So something is wrong here. At the same time if I set the target temperature for the climate component it works both on ViCare and on Home Assistant.

@oischinger
Copy link
Owner

What is the current heating mode of your heater in the app?
What kind of heater do you have?
I also only get the eco and comfort options in the old Vitotrol plus app. And these presets only work in automatic heating mode

@adorobis
Copy link
Contributor Author

adorobis commented Feb 3, 2020

It is in Auto mode (app calls it "Heating and hot water active"), it is the older Vitodens 200 device. And yes, I know Eco and Comfort are the only options but I can't set them from HA
image
image

@oischinger
Copy link
Owner

I have a Vitodens 300. Would be interesting to see what your heater exposes as available heating modes/presets

@adorobis
Copy link
Contributor Author

adorobis commented Feb 3, 2020

How can I check it?

@oischinger
Copy link
Owner

You'll have to use the python library that the integration uses directly: https://pypi.org/project/PyViCare/

E.g. python -c "from PyViCare import ViCareSession; t=ViCareSession('username','','/tmp/vicare_token.save'); print(t.getProperty('heating.gas.consumption.heating')['properties']['month']['value'][0])"

@adorobis
Copy link
Contributor Author

adorobis commented Feb 3, 2020

I've checked the API using Postman (as per instructions on pypi.org above and have found the following post methods there:

            "actions": [
                {
                    "method": "POST",
                    "isExecutable": false,
                    "href": "https://api.viessmann-platform.io/operational-data/v1/installations/230999/gateways/7571381810403109/devices/0/features/heating.circuits.0.operating.programs.eco/activate",
                    "name": "activate",
                    "title": "activate",
                    "fields": [],
                    "type": "application/json"
                },
                {
                    "method": "POST",
                    "isExecutable": false,
                    "href": "https://api.viessmann-platform.io/operational-data/v1/installations/230999/gateways/7571381810403109/devices/0/features/heating.circuits.0.operating.programs.eco/deactivate",
                    "name": "deactivate",
                    "title": "deactivate",
                    "fields": [],
                    "type": "application/json"
                }
            ]

So I undrstand that setting the Eco mode should be possible via this API. Correct me if I'm wrong. I'll try to execute this post method to see if it works. Wish me luck :)

@oischinger
Copy link
Owner

Sorry, I just arrived home and re-checked: I was accidently giving you outdated instructions.
Please run the following:
python3 -c "from PyViCare.PyViCareDevice import Device; from PyViCare.PyViCareGazBoiler import GazBoiler; t=GazBoiler('hans.oischinger@gmail.com','','/tmp/vicare_token.save'); print(t.getPrograms())"
For me the output is ['active', 'comfort', 'eco', 'external', 'holiday', 'normal', 'reduced', 'standby']

Let me know what it returns for you.

@oischinger
Copy link
Owner

you're on the right track. Executing the POST-Method is exactly what the integration does.
def activateProgram(self,program): return self.service.setProperty("heating.circuits." + str(self.service.circuit) + ".operating.programs."+program,"activate","{}")
https://github.com/somm15/PyViCare/blob/d399c6da1b0aafdadc8ae793fa3efaf2bac9810d/PyViCare/PyViCareDevice.py#L101

@adorobis
Copy link
Contributor Author

adorobis commented Feb 3, 2020

I'm struggling with testing those POST methods. As per definition they should not require any data to be provided but I'm receiving the following response:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Payload Validation Error"
}

Any hints?

@adorobis
Copy link
Contributor Author

adorobis commented Feb 3, 2020

btw when running your command I have also received ['active', 'comfort', 'eco', 'external', 'holiday', 'normal', 'reduced', 'standby']

@oischinger
Copy link
Owner

Do you get the same http code when you use PyVicare to post it?

@adorobis
Copy link
Contributor Author

adorobis commented Feb 3, 2020

don't know yet how to do it :)

@oischinger
Copy link
Owner

Instead of getPrograms() use activateProgram('eco')

@oischinger
Copy link
Owner

Could it be that your heater is in forcedNormal instead of auto? Then the programs can't be set I believe

@adorobis
Copy link
Contributor Author

adorobis commented Feb 3, 2020

I don't think so (I'm sure it is not). When no special program is activated t.getActiveProgram() returns: normal. When I select Comfort on room controller t.getActiveProgram() returns comfort. When eco is activated this API call returns eco. But when I try to run t.activateProgram("comfort") I get

Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'comfort' is not defined

as a result. The same if I run it with eco parameter or run any other command that refers to comfort program (e.g. t.getDesiredTemperatureForProgram("comfort"))

@adorobis
Copy link
Contributor Author

adorobis commented Feb 3, 2020

Another observation: setDomesticHotWaterTemperature(42) works properly from command line but when I try to change this temperature from lovelace interface for the water_heater.vicare_water entity the change does not make any effect neither if done via service test in developer tools.

@oischinger
Copy link
Owner

I just noticed that there is a bug in the water heater component in this repo. It doesn't set the commanded temperature but instead the current temperature.
Try setting the temperature of the climate component via lovelace it should work.

The issue with the presets is obviously a different one.
Please try to call t.getActiveMode()
Then we know if you're on forcedNormal or not.

@oischinger
Copy link
Owner

By the way I'm not sure if the water heater Temperature bug also exists in the official integration in HA (vs. This custom component). I'll check today evening.
Which one are you using?

@adorobis
Copy link
Contributor Author

adorobis commented Feb 4, 2020

getActiveMode() returns dhwAndHeating
I'm using the official HA integration, I have not been installing any custom component.

@adorobis
Copy link
Contributor Author

adorobis commented Feb 4, 2020

Btw, when testing the vicare APIs in Postman I have received full list of available commands by calling features API (attaching here). One thing that got my attention is that for just a few APIs there is a parameter "isExecutable": false and that is actually for the ones that activate and deactivate eco and comfort modes as well as a few others (not so important I think). Do you know if that might indicate that actually those APIs are not available for my heater?
vicare api features.txt

@oischinger
Copy link
Owner

oischinger commented Feb 7, 2020

Here's my output of print(t.service.getProperty('heating.circuits.0.operating.programs.eco'))"

{'links': [{'rel': ['self'], 'href': 'https://api.viessmann-platform.io/operational-data/v1/installations/998/gateways/7555115510033104/devices/0/features/heating.circuits.0.operating.programs.eco'}, {'rel': ['up'], 'href': 'https://api.viessmann-platform.io/operational-data/v1/installations/998/gateways/7555115510033104/devices/0/features'}, {'rel': ['http://schema.viessmann.com/link-relations#live-updates', 'https://wiki.viessmann.com/display/VPL/Relations#Relations-live-updates'], 'href': '/operational-data/installations/998/gateways/7555115510033104/devices/0/features/heating.circuits.0.operating.programs.eco'}], 'class': ['heating.circuits.0.operating.programs.eco', 'feature'], 'properties': {'active': {'type': 'boolean', 'value': False}, 'temperature': {'type': 'number', 'value': 22}}, 'entities': [{'rel': ['http://schema.viessmann.com/link-relations#feature-meta-information', 'https://wiki.viessmann.com/display/VPL/Relations#Relations-feature-meta-information', 'https://wiki.viessmann.com/display/VPL/Amounts#Amounts-unique'], 'properties': {'apiVersion': 1, 'isEnabled': True, 'isReady': True, 'gatewayId': '7555115510033104', 'feature': 'heating.circuits.0.operating.programs.eco', 'uri': '/v1/gateways/7555115510033104/devices/0/features/heating.circuits.0.operating.programs.eco', 'deviceId': '0', 'timestamp': '2020-02-07T19:24:08.424Z'}}], 'actions': [{'method': 'POST', 'isExecutable': True, 'href': 'https://api.viessmann-platform.io/operational-data/v1/installations/998/gateways/7555115510033104/devices/0/features/heating.circuits.0.operating.programs.eco/activate', 'name': 'activate', 'title': 'activate', 'fields': [], 'type': 'application/json'}, {'method': 'POST', 'isExecutable': False, 'href': 'https://api.viessmann-platform.io/operational-data/v1/installations/998/gateways/7555115510033104/devices/0/features/heating.circuits.0.operating.programs.eco/deactivate', 'name': 'deactivate', 'title': 'deactivate', 'fields': [], 'type': 'application/json'}]}

Seems for me the isExecutable is set for activate of eco. Dunno why it is different for you

@oischinger
Copy link
Owner

It might just be that your heater doesn't support setting these programs.

@adorobis
Copy link
Contributor Author

adorobis commented Feb 9, 2020

OK, might be related to what Viessmann is enabling in the API for my heater (Vitodens 200). For curiosity, can you enable Eco and Comfort modes in the ViCare mobile app? And I can use those programs with Vitotrol 300 controller.

@oischinger
Copy link
Owner

The ViCare app doesn't seem to have that feature. The old Vitotrol Plus app, which I still have on my phone, does however allow it.

@oischinger
Copy link
Owner

It does not seem that something in the HA integration could solve the problem.

@adorobis
Copy link
Contributor Author

adorobis commented Feb 9, 2020

Many thanks for your support! Now how about connecting directly to the heater via the optical - usb cable or through the Vitoconnect? Seems the ViCare cloud service is not very reliable.

@oischinger
Copy link
Owner

There are some diy solutions I believe. Just google for optolink. I never experimented with that. I'd prefer a local API through the (W)LAN interface but it doesn't exist (yet?)
I asked for it @viessmann. Not really expecting anything to happen in the near future.

@adorobis
Copy link
Contributor Author

adorobis commented Feb 9, 2020

Sure standard API to the device would be great. I think the viessmann cable should work well as it is a usb cable. Have to test it in free time.

@oischinger
Copy link
Owner

I'd be interested. Let me know about your findings

@adorobis
Copy link
Contributor Author

I've contacted Viessmann and they've told me that they will be opening up a develooper's portal and publishing their local API, this should take a few more weeks. This is great news and an opportunity to become independent from their cloud services :)

@oischinger
Copy link
Owner

I'd really prefer a local API let's see if (and when) they stick to their promise

@geertmeersman
Copy link

SmartSelect_20200220-072247_Gmail
Seems they really are getting serious

@oischinger
Copy link
Owner

I received the same mail 2 months ago.
In don't see any commitment to a local API there. I guess they are more likely to offer free and paid tiers for their cloud API.
Still hoping for local though 😁

@geertmeersman
Copy link

Indeed... Just completed their survey and it is clear they just want to go for paid services...
I pushed in each answer for a local API, but not sure they seem to be willing to invest money in that.... But let's stay positive!

@adorobis
Copy link
Contributor Author

Just received the same notification from Viessmann. Did you hear anything more from them already?

@geertmeersman
Copy link

geertmeersman commented Mar 13, 2020 via email

@vandenberghev
Copy link
Contributor

You might want to read that again, this is not the same message. It says they're blocking access to the API next week, rendering all third-party applications useless.

Don't hold out hope for their 'developer portal', it's most likely just a way to monetize the API.

an evaluation has shown that you have used the web interface to Viessmann IoT Services very frequently in recent days.

On the one hand, we are delighted to know you are taking a closer look at our products and solutions. Especially since you have (apparently) found a solution for your specific use case without a description or our support from our side.
On the other hand, it challenges us to check and channel the method and frequency of requests to our IoT Services in order to keep those stable and available for all our users.

That’s why we have now taken the decision to limit access to our API. From the coming week on, a threshold will become active that prevents from unauthorized use of the API. This will affect all third-party solutions, which can thereby no longer be used.

We are aware that the demand for APIs to our technologies for integration into other solutions and third-party systems is increasing. To provide you with an opportunity for this, we will launch a portal in the next two months for all developers to get access to our API. With the Viessmann Developer Portal, we intend to open ourselves up, release a documentation of the interface and co-develop new solutions together with you. In addition, we are planning to provide you with useful information around our heating systems you need for your development and to offer you a first-level support concerning our APIs.

As one of the users who is already working with our API, we would like to invite you to an early access to the Developer Portal. If you are interested, please fill out this short form. The access to the pre-version of the Portal will be sent to you within the next weeks.

We hope you understand the decision that we have to take. If you are interested to support us, on further development on the API and to explore new possibilities, we are very happy to welcome you to our Developer Portal soon!

In the meantime in case you have any questions, feel free to contact us under developer@viessmann.com.

Thank you for your understanding.

All the best!

Your Viessmann Developer Portal Team

@oischinger
Copy link
Owner

I contacted them and asked them for some transition period until they offer a new API. Not really expecting much but let's see.

@adorobis
Copy link
Contributor Author

Since yesterday the API doesn't (mostl of the time) work. But neither is the mobile ViCare app. Do you know if this is caused by the announced closing of their API?

@adorobis
Copy link
Contributor Author

And btw, maybe we could negotiate with viessmann some usage limits of their API, currently probably the integration is calling the API too frequently and there is no parameter to set the maximum frequency (correct me if I'm wrong).

@adorobis
Copy link
Contributor Author

adorobis commented Mar 17, 2020

I've just received their response, inviting to a discussion on viessmann forum https://bit.ly/39X0Iqp:

thank you for your reply! I am sorry for inconvenience that you experience right now with the use of our API and the ViCare app.

We are in dialogue with the users and in this context we will also be presenting our upcoming Viessmann Developer Portal. It is very helpful if you participate in the exchange in the community. Click here for the dialogue: https://bit.ly/39X0Iqp

Best regards,

Michael Hanna

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

4 participants