Closed mr-gosh closed 2 years ago
Did you try to run the convert-application on windows?
To be honest - i don't have one 😁 I could use a notebook of a collegue - or we try to get it running on linux - so this could be added to the supported platfrom list. 🤗
I have tried running it an a linux based docker image with no issues. I will add some logging - then you can try it again.
@mr-gosh please try this version and provide the logfile: https://github.com/BoBiene/Wolf-Smartset-to-openhab/suites/623047638/artifacts/4940705
Hi, i tried your version but don't find a .log file?
here a little more information about my setup.
Output of my .net runtime 2.1:
$ dotnet-runtime-21.dotnet --info
Host (useful for support):
Version: 2.1.17
Commit: 7b9e4ef7c1
.NET Core SDKs installed:
No SDKs were found.
.NET Core runtimes installed:
Microsoft.NETCore.App 2.1.17 [/snap/dotnet-runtime-21/22/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Output of my .net runtime 3.1:
$ dotnet-runtime-31.dotnet --info
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8
.NET Core SDKs installed:
No SDKs were found.
.NET Core runtimes installed:
Microsoft.NETCore.App 3.1.3 [/snap/dotnet-runtime-31/4/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
output of dotnet-runtime-31.dotnet ./WolfSmartsetCollector.dll -u "myusername" -p "mysupersecurepassword"
Failed to create CoreCLR, HRESULT: 0x80070008
Hi @mr-gosh,
sorry i forgot to mention that I switched to the most recent dotnet version 3.1.
The is no log file created, output is printed to console.
Ah, ok - yeah. Recognized that and therefore installed 3.1.3 for the test. Does the result Help you in any way?
@mr-gosh can you please try the docker image: https://hub.docker.com/r/bobiene/wolfsmartset-to-openhab
@mr-gosh can you please try the docker image: https://hub.docker.com/r/bobiene/wolfsmartset-to-openhab
Hey @BoBiene - thanks for putting this together. It seems like the login worked but another step fails (GatewayID & SystemID had real numbers I removed for the public post):
Try to authenticate at portal/connect/token
Login successfull...
Requesting system list
Got valid response for portal/api/portal/GetSystemList (Paramter: Authorization=****)
Got valid response for portal/api/portal/GetGuiDescriptionForGateway (Paramter: GatewayId=xxx, SystemId=yyyyy, Authorization=****)
Failed: System.NullReferenceException: Object reference not set to an instance of an object.
at WolfSmartsetCollector.Program.Run(Options options) in /src/WolfSmartsetCollector/Program.cs:line 82
@mr-gosh to investigate this i need more information. please run
docker run --rm -v <<PATH_TO_CREATE_FILES>>:/app/generated/ bobiene/wolfsmartset-to-openhab:develop -u "<<USERNAME>>" -p "<<PASSWORD>>" -d
and then
docker run --rm -v <<PATH_TO_CREATE_FILES>>:/app/generated/ bobiene/wolfsmartset-to-openhab:develop -u "<<USERNAME>>" -p "<<PASSWORD>>" -d -e
afterwards i need the console output of the second execution and the files inside
<<PATH_TO_CREATE_FILES>>/portal/**
Please use the correct docker-image path bobiene/wolfsmartset-to-openhab:develop and take note of then additional parameter -d and -e
If you don't want to post the files public, you can send me a mail to github@bo-biene.de
@mr-gosh Have you had a chance to try this out?
docker run --rm -v <
>:/app/generated/ bobiene/wolfsmartset-to-openhab:develop -u "< >" -p "< >" -d
drops an errormessage:
Creating file /app/generated/rules/wolf_smartset.rules
Creating file /app/generated/items/wolf_smartset.items
Creating file /app/generated/sitemaps/wolf_smartset.sitemap
Try to authenticate at portal/connect/token
Login successfull...
Requesting system list
Got valid response for portal/api/portal/GetSystemList (Paramter: Authorization=****)
Dumped request to /app/generated/portal/api/portal/GetSystemList/200513340824.json
Got valid response for portal/api/portal/GetGuiDescriptionForGateway (Paramter: GatewayId=286, SystemId=12949, Authorization=****)
Dumped request to /app/generated/portal/api/portal/GetGuiDescriptionForGateway/200513340824.json
Failed: System.NullReferenceException: Object reference not set to an instance of an object.
at WolfSmartsetCollector.Program.Run(Options options) in /src/WolfSmartsetCollector/Program.cs:line 92
Output of:
docker run --rm -v <
>:/app/generated/ bobiene/wolfsmartset-to-openhab:develop -u "< >" -p "< >" -d -e
Creating file /app/generated/rules/wolf_smartset.rules
Creating file /app/generated/items/wolf_smartset.items
Creating file /app/generated/sitemaps/wolf_smartset.sitemap
Try to authenticate at portal/connect/token
Login successfull...
Requesting system list
Got valid response for portal/api/portal/GetSystemList (Paramter: Authorization=****)
Dumped request to /app/generated/portal/api/portal/GetSystemList/200513350852.json
Failed: System.Exception: Cannot unmarshal type Unit
at WolfSmartsetCollector.JSON.UnitConverter.ReadJson(JsonReader reader, Type t, Object existingValue, JsonSerializer serializer) in /src/WolfSmartsetCollector/JSON/GuiDescriptionForGatewayResponse.cs:line 410
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at WolfSmartsetCollector.JSON.JsonNetSerializer.Deserialize[T](IRestResponse response) in /src/WolfSmartsetCollector/JSON/JsonNetSerializer.cs:line 24
at RestSharp.RestClient.Deserialize[T](IRestRequest request, IRestResponse raw)
at RestSharp.RestClient.Execute[T](IRestRequest request)
at WolfSmartsetCollector.Program.Run(Options options) in /src/WolfSmartsetCollector/Program.cs:line 85
@mr-gosh thank you. To take a look at this, can you please send me a mail with the content of
<
@mr-gosh thank you. To take a look at this, can you please send me a mail with the content of
<
>/portal/**
Did that already - Mail left a few minutes after the post.
Hi @mr-gosh,
should be fixed. Please run
docker pull bobiene/wolfsmartset-to-openhab:develop
and then try to genereate your files.
that seemed to have worked @BoBiene Thanks a lot - i'll try to integrate that into openhab tomorrow!
What was the Problem?
@mr-gosh great to hear. The main problem was, that I used a c# class generator for the json classes and there was generated a enum for units. And there was missing some units. I changed to strings at this point so it should not be an issue anymore.
Hi, I copied everything in the right folders of the persistant storage if my Openhab Docker-Container and changed the permissions as needed - but I'm not sure how to activate the generated "binding" - or the new Heating-Item? Could we clarify thins in the Read.me or is this out if scope of the documentation from your point of view?
Hi @mr-gosh,
if everything is on the right place you should have several items in openhab for your heating device. A sitemap is generated so you should also be able to view this if you use the basic UI or the app.
Hi @mr-gosh,
did you get it to work?
nope - i don't get the things to appear in openhab. i installed the basic interface and copied everything into the right folders - but it doesn't appear. not sure what i'm doing wrong there...
@mr-gosh if you like to open a sitemap you need to pass a parameter like http://openhab/basicui/app?sitemap=wolf_smartset
Strange - no error when trying to load that one
is it possible that there is missing something in the generated files or do I need to setup someting to use the basic ui? Cause until now I only used the paper-ui.
The Files look a little empty:
sitemap wolf_smartset label="Wolf Smartset" icon="heating" { }
"rules" and "items" are empty files.
@mr-gosh hmm the item file should look like this:
@mr-gosh found the missing boolean return ;) Should be fixed with the latest docker build.
Try a
docker pull bobiene/wolfsmartset-to-openhab
And then execute with
docker run --rm -v <<PATH_TO_CREATE_FILES>>:/app/generated/ bobiene/wolfsmartset-to-openhab -u "<<USERNAME>>" -p "<<PASSWORD>>"
@BoBiene that filled the basic-ui - Thanks!
BUT, it seems that some things don't get the connection:
@mr-gosh that got us one step forward 👍 Just to make shure: you've copied all the files (including the rules, scripts and items?)
You can change the log-level of the rule (search and replace logDebug) and look inside the openhab log to see whats wrong. I think the path to the scripts could be wrong (etc/openhab2/scripts/)
Yes - I copied all files:
/openhab/openhab_conf$ tree -sh
.
├── [4.0K] html
│ ├── [ 451] index.html
├── [4.0K] icons
│ └── [4.0K] classic
├── [4.0K] items
│ └── [ 15K] wolf_smartset.items
├── [4.0K] persistence
├── [4.0K] rules
│ └── [188K] wolf_smartset.rules
├── [4.0K] scripts
│ ├── [ 180] request_config.sh
│ ├── [ 275] request_token.sh
│ └── [ 648] request_values.sh
├── [4.0K] services
│ ├── [2.2K] addons.cfg
│ └── [3.6K] runtime.cfg
├── [4.0K] sitemaps
│ └── [ 241] wolf_smartset.sitemap
├── [4.0K] sounds
│ ├── [8.6K] barking.mp3
│ └── [100K] doorbell.mp3
├── [4.0K] things
└── [4.0K] transform
├── [ 38] de.map
├── [ 38] en.map
12 directories, 23 files
ok, it looks like the "scripts" folder is not attached to the right destination in my Docker-Container:
==> ./openhab_userdata/logs/openhab.log <==
2020-05-26 09:32:00.409 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_WLANAktiv=bash: /etc/openhab2/scripts/request_values.sh: No such file or directory
2020-05-26 09:32:00.411 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_WLANSignal=bash: /etc/openhab2/scripts/request_values.sh: No such file or directory
Ahhh - in your "wolf_smartset.rules" you work with absolut paths, so your Idea of tzhe wrong paths is right:
jsonValues = executeCommandLine("bash@@/etc/openhab2/scripts/request_values.sh@@"+token+"@@286@@12949@@5500@@"+ValueIds+"",5000);
these are in a different location in my setup (in my docker container the files are located in /openhab/conf/scripts/ ). I searched and replaced all paths regarding to the right location - so the bash errors vanished but the values are still empty. I will try to extend the log-level later.
it seems the scripts only return emty strings:
2020-05-26 10:10:00.743 [INFO ] [.eclipse.smarthome.model.script.Wolf] - Heizgeraet_ParameterHG_FunktionAusgangA4=
2020-05-26 10:10:00.743 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert '' to a state type which item 'Heizgeraet_ParameterHG_FunktionAusgangA4' accepts: [DecimalType, QuantityType, UnDefType].
2020-05-26 10:10:00.744 [INFO ] [.eclipse.smarthome.model.script.Wolf] - Heizgeraet_ParameterHG_MinimaleSchalthystereseBrenner=
2020-05-26 10:10:00.744 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert '' to a state type which item 'Heizgeraet_ParameterHG_MinimaleSchalthystereseBrenner' accepts: [DecimalType, QuantityType, UnDefType].
2020-05-26 10:10:00.745 [INFO ] [.eclipse.smarthome.model.script.Wolf] - Heizgeraet_ParameterHG_WWRegelung=
2020-05-26 10:10:00.745 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert '' to a state type which item 'Heizgeraet_ParameterHG_WWRegelung' accepts: [DecimalType, QuantityType, UnDefType].
2020-05-26 10:10:00.948 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_DHCPAktiv=
2020-05-26 10:10:00.950 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_IPAdresse=
2020-05-26 10:10:00.952 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_Subnetzmaske=
2020-05-26 10:10:00.954 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_DefaultGateway=
2020-05-26 10:10:00.955 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_DNSNamensserver=
2020-05-26 10:10:00.957 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_WLANAktiv=
2020-05-26 10:10:00.959 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_WLANSignal=
2020-05-26 10:10:00.960 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert '' to a state type which item 'ISM_WLANSignal' accepts: [DecimalType, QuantityType, UnDefType].
2020-05-26 10:10:00.961 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_Anlagenname=
2020-05-26 10:10:00.963 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_ISMSeriennummer=
2020-05-26 10:10:00.963 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_ISMSoftwareversion=
2020-05-26 10:10:00.964 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_ISMHardwareversion=
2020-05-26 10:10:00.965 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_FreigabeInternetverbindung=
2020-05-26 10:10:00.966 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_LANMACAdresse=
2020-05-26 10:10:00.967 [INFO ] [.eclipse.smarthome.model.script.Wolf] - ISM_WLANMACAdresse=
@BoBiene any hints how I should proceed?
@mr-gosh have you checked all the pathes to the script files in the rule? Have you tried to change the log-level of the debug messages in the rule to get more information?
@mr-gosh have you checked all the pathes to the script files in the rule?
from my point of view - yes it seems that there are 7 positions where the path needed to be changed
Have you tried to change the log-level of the debug messages in the rule to get more information?
no - there are 285 entires in the rule beginning with "log" - a lot of them are already "logDebug" - what sould I do? replace all "logError" & "logInfo" with "logDebug"?
Hi @mr-gosh ,
you can enable debug logoutput in openhab or search & replace logDebug with a level being logged with your configuration.
@mr-gosh Have you installed the JsonTransform?
I didn't forget about this - I just didn't find helping logs entries until now :(
@mr-gosh Have you installed the JsonTransform?
Nope - how should I do that? And what should I do with that?
I use OpenHAB via a docker container and mounted the generated profiles into the container via persistant storage mounts.
@mr-gosh: https://www.openhab.org/addons/transformations/jsonpath/ https://www.openhab.org/docs/configuration/addons.html
The scripts uses the json-transform plugin (https://github.com/BoBiene/Wolf-Smartset-to-openhab#openhab-runtime-requirements)
@mr-gosh: https://www.openhab.org/addons/transformations/jsonpath/ https://www.openhab.org/docs/configuration/addons.html
The scripts uses the json-transform plugin (https://github.com/BoBiene/Wolf-Smartset-to-openhab#openhab-runtime-requirements)
yes - I installed the json transform plugin (now)
should I test the 1.43 Release or do you want to change something else?
@mr-gosh I will fix https://github.com/BoBiene/Wolf-Smartset-to-openhab/issues/7, but with 1.43 it should work for most values.
@mr-gosh I will fix #7, but with 1.43 it should work for most values.
did you update the docker image as well?
After these changes a lot seem to work
There are still complete empty areas like the ISM Page
And the time and dates that are shown seem to be empty but it looks promissing now. (You still need to change the absolute paths in the "wolf_smartset.rules" file)
@mr-gosh i have created a binding for openHAB 3.1, if you like you can try this out: https://github.com/openhab/openhab-addons/pull/10751
I want to test the pulling the information of my Wolf Smartset Cloud instance via your module. But I use the docker version of OpenHAB2 - could you give me some hints about the installation process?
I like to submit my test results to your documentation.
I installed dotnet in my ubuntu machine and tried to execute your command (after figuring out that 2.1 is needed) which gives me the following error: