zivillian / ism7mqtt

GNU General Public License v3.0
56 stars 10 forks source link

Device Template not found #9

Closed feuse8 closed 2 years ago

feuse8 commented 2 years ago

Hi,

I've been trying to get it work with ism7-e. I tried it on Windows and also on a CentOS VM. I have a Wolf ism7-e, BWM-1 and BWS-1. Sometimes the values are read but most of the times the application is just crasing / finishing after one try. No values are sent to my MQQT Queue / even the topics are not created. Am I missing some important configuration? Pls find attached my Files.

Thanks for your help ism7.zip .

zivillian commented 2 years ago

From the debug log it looks like it should be supported. I guess there is an unsupported parameter on one of your devices. Could you try with only a single device (Just remove everything except a single Device from your parameter.json - one after the other) until you find the broken device? Please be aware, that the ISM7 might need a few seconds (or one minute), before accepting a new connection after a disconnect.

zivillian commented 2 years ago

You can also just try the 0.0.4 release (published just now). This includes debug output for the unsupported UnicodeTextConverter which already caused trouble. If you see UnicodeTextConverter T:<...> H:<...> L:<...> in the output you are also affected. If H differs from 128 or L differs from 0 I would like to get the log, so I can finally implement this converter.

feuse8 commented 2 years ago

Hi, I tried to create a minimal Configuration with only 1 Value in the JSON. The Reconnect now seems to work reliably. But a MQTT entry is not created and every time I execute the application, it's always closing after 1 read attempt. ism7.zip .

feuse8 commented 2 years ago

Ok I started to debug and it seems there is no device template for the following device: <busDevice ba="0x8" sv="0x80" sr="0x0" cfg="0x405A" did="0x1E"/>

If you don't have a script I can create an XML Entry for the device.

zivillian commented 2 years ago

That's interesting. Looks like there is another way to get the parameter for each device. Adding it to the XML file is not the solution - those are the latest config file from the Smartset app. I'll look into this, but I may take while...

zivillian commented 2 years ago

This was easier than expected. Can you test the build from https://github.com/zivillian/ism7mqtt/actions/runs/1785869727? If this works, I will merge the PR.

feuse8 commented 2 years ago

Cool! Thanks a lot!

Seems to work better except for one situation: the system sends data from ba 0x15 which has no corresponding entry in the parameters.json. This causes the app to crash. I fixed it for me by replacing .first() with firstOrDefault() in the ISM7Config addDevice and by adding a check if the key exists in GetTelegramIdsForDevice.

zivillian commented 2 years ago

Can you send me a trace where the system sends from 0x15?

feuse8 commented 2 years ago

Looks like _config.Devices is not contained in the JSON File. I created two Screenshots. Maybe they can help. Otherwise it would be cool if you could tell me how to create the Trace.

The bus device info is: <busDevice ba="0x15" sv="0x2" sr="0x4" cfg="0x0" did="0x18"/></busDevices>

Does it maybe relate to the isVisible flag in the smartsec Database? Seems like invisible DeviceBos are not loaded.

AddDevice OnSystemConfigAsync

zivillian commented 2 years ago

By trace I just meant the debug log, but I know what the problem is. You are correct, that invisible devices are not included in the parameter.json, but they also have a DeviceTemplateId 0 which is not included in the DeviceTemplates.xml. I'll add a check and update the PR.

zivillian commented 2 years ago

Can you test again with https://github.com/zivillian/ism7mqtt/actions/runs/1786535340?

feuse8 commented 2 years ago

Thanks a lot! Now it works like a charm!

zivillian commented 2 years ago

There will soon be a new release, but I'd like to wait for #10 / #12