CyberDNS / Lupusec2Mqtt

Lupusec Alarm System to Mqtt
MIT License
11 stars 5 forks source link

Integrate Shutters #34

Closed mentor7785 closed 1 year ago

mentor7785 commented 1 year ago

Hello everyone, after setup the repo, I miss the shutters in the entity-list. Is it possible to integrate and control the shutters as well?

Unfortunately, I have no knowledge of C# - I would need your help here.

Thx and kind regards mentor7785

CyberDNS commented 1 year ago

Hi @mentor778,

Unfortunately I have no shutters integrated in my Lupusec so I cannot analyze the API calls. Do you have the possibility to do the analysis?

Best regards, @CyberDNS

mbay0r commented 1 year ago

@CyberDNS i would also be very happy about this, what can i do to help? how can i do the analysis?

mbay0r commented 1 year ago

Raise shutter:

script.js:48 {exec: 'a=1&z=6&shutter=on'} exec: "a=1&z=6&shutter=on"[[Prototype]]: Object

Stop shutter up/down:

script.js:48 {exec: 'a=1&z=6&shutter=stop'} exec: "a=1&z=6&shutter=stop"[[Prototype]]: Object

Shutter down:

script.js:48 {exec: 'a=1&z=6&shutter=off'} exec "a=1&z=6&shutter=off"[[Prototype]]: Object

Google Chrome Devtools -> Console: output while I raise, stop or lower the shutters. z=6 should be the ID (zone) of the device, it changes when I operate another shutter. a=1 should be the area, I have shutters in area 1 and 2.

@CyberDNS @ChrisKeck Can you already do something with it?

thank you very much!

mbay0r commented 1 year ago

I forgot one function:

shutter to 0% (closed):

{exec: 'a=1&z=6&shutter=0'} ... shutter to 100% (open):

{exec: 'a=1&z=6&shutter=99'}

CyberDNS commented 1 year ago

You can also check what you see in the Network tab of the devtools, mainly I need the "deviceGet" payload and "recordListGet" payload (json). There you can identify what your shutters are and hopefully we will see the state/value (e.g. opened, closed or some kind of percentage of openess).

Then you could execute an open/close/stop command and see what messages are showing up in the network tab.

mbay0r commented 1 year ago

Good Morning,

at recordListGet I find only sensors, but no wireless switches.

Here is the midsection of one of my shutters, I hope it helps. Otherwise feel free to let me know.

"area": 2, "zone": 15, "type": 76, "type_f": "{D_TYPE_76}", "name": "Rollladen Schlafzimmer", 
"tag": "", 
"cond": "", "cond_ok": "1", "battery": "", "battery_ok": "1", 
"tamper": "", "tamper_ok": "1", "bypass": 0, "rssi": "{WEB_MSG_STRONG}  8", 
"resp_mode": [0,0,0,0,0,0], "ammeter": "0", "ver": "SCM_00.00.03.14TC", 
"bypass_tamper": 0, 
"sid": "ZS:4a2b01", "su": 1, "alarm_status": "", "status_ex": "0", "meta": "", "onOff": "0", "level": "0", "shutter_turn": "0", "manu": "ClimaxTechnology", "serial": "20161213        ", "profile": 260, "device": 512, "cluster": [256,8,6,5,4,3,0], "ias_type": 0, "consumer_id": 0, "always_off": 0, "g_1": 1, "g_2": 0, "g_3": 0, "g_4": 0, "g_5": 0, "g_6": 0, "g_7": 0, "g_8": 0},
{"area": 2, "zone": 15, "type": 76, "type_f": "{D_TYPE_76}", "name": "Rollladen Schlafzimmer", 
"tag": "", 
"cond": "", "cond_ok": "1", "battery": "", "battery_ok": "1", 
"tamper": "", "tamper_ok": "1", "bypass": 0, "rssi": "{WEB_MSG_STRONG}  8", 
"resp_mode": [0,0,0,0,0,0], "ammeter": "0", "ver": "SCM_00.00.03.14TC", 
"bypass_tamper": 0, 
"sid": "ZS:4a2b01", "su": 1, "alarm_status": "", "status_ex": "0", "meta": "", "onOff": "1", "level": "0", "shutter_turn": "0", "manu": "ClimaxTechnology", "serial": "20161213        ", "profile": 260, "device": 512, "cluster": [256,8,6,5,4,3,0], "ias_type": 0, "consumer_id": 0, "always_off": 0, "g_1": 1, "g_2": 0, "g_3": 0, "g_4": 0, "g_5": 0, "g_6": 0, "g_7": 0, "g_8": 0},
{"area": 2, "zone": 15, "type": 76, "type_f": "{D_TYPE_76}", "name": "Rollladen Schlafzimmer", 
"tag": "", 
"cond": "", "cond_ok": "1", "battery": "", "battery_ok": "1", 
"tamper": "", "tamper_ok": "1", "bypass": 0, "rssi": "{WEB_MSG_STRONG}  8", 
"resp_mode": [0,0,0,0,0,0], "ammeter": "0", "ver": "SCM_00.00.03.14TC", 
"bypass_tamper": 0, 
"sid": "ZS:4a2b01", "su": 1, "alarm_status": "", "status_ex": "0", "meta": "", "onOff": "1", "level": "100", "shutter_turn": "0", "manu": "ClimaxTechnology", "serial": "20161213        ", "profile": 260, "device": 512, "cluster": [256,8,6,5,4,3,0], "ias_type": 0, "consumer_id": 0, "always_off": 0, "g_1": 1, "g_2": 0, "g_3": 0, "g_4": 0, "g_5": 0, "g_6": 0, "g_7": 0, "g_8": 0},

Level 100 is fully open Level 0 is fully closed

thank you very much!

CyberDNS commented 1 year ago

Hi, I published a new "Edge" version 2.1.0 that provides already the state of the cover/shutter (open, closed, position). So you can already test this if it works fine.

Then for controlling the cover I need additional information: In chrome dev tools you should see the commands in the network tab when you control the shutter via Lupusec Web UI. Normally you should see some POST messages, but not sure about this.

Regards, David

mbay0r commented 1 year ago

Hi David, looks good! thank you very much!

weren't those the commandos (parsed)?

shutter to 0% (closed): {exec: 'a=1&z=6&shutter=0'}

shutter to 100% (open): {exec: 'a=1&z=6&shutter=99'}

source:

https://192.168.178.27/action/haExecutePost

a is area and z is zone (Device ID)

Requesturl:

https://192.168.x.x/action/haExecutePost

Response is:

{
  "result" : 1,
  "message" : "{WEB_MSG_SUBMIT_SUCCESS}"
}

Is it still possible to display the position in % in the user interface somehow?

CyberDNS commented 1 year ago

Ok I will try to implement that, I think I have to do a POST command to the route you provided and the data has to be form encoded.

For the position, I am not sure, for the moment I publish the value directly as it is coming from Lupusec into MQTT, so if it is going from 0 to 100 it should match with the default values of HA. Probably you can provide a screenshot of what you mean and an extract of what is published in that situation in MQTT.

mbay0r commented 1 year ago

Yes, that's fine. i think its post too.

I mean, when I open an element in HA, I see the slider.

But this is always at the same position, even if the shutters are already half closed. Is it still possible to query the current position here? And then set the slider as the current position is?

Screenshot_20221217_162318

And then here still somehow make visible, how much % it is open?

Screenshot_20221217_162519

here you can see how it looks like in the Lupus

Screenshot_20221217_162658

thank you!

CyberDNS commented 1 year ago

Ok, and when it is in Lupusec UI at 70, in the JSON you have the level at 70, too? In that case it is a bug in my code, because I tried to implement it like this.

mbay0r commented 1 year ago

Do you mean the JSON level in HA? How can I see that?

CyberDNS commented 1 year ago

Found the issue. It seems to be a small bug in home assistant itself, if I add the possibility to control the position of the cover, it works perfectly fine, but if not, then all values greater than 0 do not show any position.

mbay0r commented 1 year ago

Sorry, it is

a=1&z=6&shutter=stop

mbay0r commented 1 year ago

When it is 0% (Closed) you can use

a=1&z=6&shutter=on

to fully open.

and

a=1&z=6&shutter=off

to fully close.

CyberDNS commented 1 year ago

You already mentioned it, I found it above 😉

CyberDNS commented 1 year ago

You can check, I have pushed a new version 2.2.0

mbay0r commented 1 year ago

does not work :-( cant go up/down/stop.

Slider still at 0 and does not work also.

CyberDNS commented 1 year ago

Sorry for that, do you see some error message in the logs. And can you investigate what is pushed to MQTT please.

mbay0r commented 1 year ago
[18:45:57 INF] Command OPEN sent to device ZS:5e4b01 Rollladen Wohnzimmer Hof {"SourceContext": "Lupusec2Mqtt.Lupusec.PollingHostedService"}
[18:51:28 INF] Command 38 sent to device ZS:5e4b01 Rollladen Wohnzimmer Hof {"SourceContext": "Lupusec2Mqtt.Lupusec.PollingHostedService"}
[18:51:30 INF] Command STOP sent to device ZS:5e4b01 Rollladen Wohnzimmer Hof {"SourceContext": "Lupusec2Mqtt.Lupusec.PollingHostedService"}
2022-12-17 18:55:16: Received PUBLISH from Lupusec2Mqtt (d0, q0, r1, m0, 'homeassistant/cover/lupusec/ZS_5e4b01/state', ... (6 bytes))
2022-12-17 18:55:16: Sending PUBLISH to 4ZmthNrx6uQ0lLZRl9I42d (d0, q0, r0, m0, 'homeassistant/cover/lupusec/ZS_5e4b01/state', ... (6 bytes))
2022-12-17 18:55:16: Received PUBLISH from Lupusec2Mqtt (d0, q0, r1, m0, 'homeassistant/cover/lupusec/ZS_5e4b01/position', ... (1 bytes))
2022-12-17 18:55:16: Sending PUBLISH to 4ZmthNrx6uQ0lLZRl9I42d (d0, q0, r0, m0, 'homeassistant/cover/lupusec/ZS_5e4b01/position', ... (1 bytes))
CyberDNS commented 1 year ago

Ok that seems ok to me.

Can you set Serilog:MinumumLevel:Default from Information to Debug, probably we can see more information.

mbay0r commented 1 year ago

Nothing.

i only see

[19:11:04 DBG] Device of Type 76 with name Rollladen Wohnzimmer Hof is ignored. {"SourceContext": "Lupusec2Mqtt.Lupusec.PollingHostedService"}

CyberDNS commented 1 year ago

Ok that"s weird, I will look at it tomorrow.

mbay0r commented 1 year ago

thank you very much and have a nice evening!

maybe this repo can help: https://github.com/schmupu/ioBroker.lupusec

When I was still using iobroker, it worked perfectly.

mbay0r commented 1 year ago

In https://github.com/schmupu/ioBroker.lupusec/blob/master/lib/lupusasync.js they have

let urlDeviceEditShutterPost = '/action/deviceEditShutterPost';
let urlDeviceEditShutterGet = '/action/deviceEditShutterGet';
CyberDNS commented 1 year ago

Yes, I already found that. I will look at it in detail tomorrow. Have a nice evening.

CyberDNS commented 1 year ago

Nothing.

i only see

[19:11:04 DBG] Device of Type 76 with name Rollladen Wohnzimmer Hof is ignored. {"SourceContext": "Lupusec2Mqtt.Lupusec.PollingHostedService"}

Is it possible that you see the shutters in /action/deviceListPSSGet with type id 76?

CyberDNS commented 1 year ago

In https://github.com/schmupu/ioBroker.lupusec/blob/master/lib/lupusasync.js they have

let urlDeviceEditShutterPost = '/action/deviceEditShutterPost';
let urlDeviceEditShutterGet = '/action/deviceEditShutterGet';

Can you investigate in Dev Tools what exactly is posted on deviceEditShutterPost action, what are the values for 'on_time' and 'off_time' if you open, close and stop your shutters, please?

mbay0r commented 1 year ago

from

deviceListPSSGet

{"area": 1, "zone": 6, "type": 76, "type_f": "{D_TYPE_76}", "name": "Rollladen Wohnzimmer Hof", "id": "ZS:5e4b01", "level": 64, "consumer_id": 0, "ammeter": 0, "always_off": 0, "shutter_turn": 0, "hue": "-1", "sat": "-1", "ctemp": "-1", "hue_cmode": "-1", "hue_cie_x": "-1", "hue_cie_y": "-1", "hue_color_cap": "0", "nuki": "-1", "status": ""},

mbay0r commented 1 year ago

i can not see any action on deviceEditShutterPost . :-(

Screenshot_20221218_091228

the action happens to script.js, i think.

CyberDNS commented 1 year ago

Hi, I pushed just now a new version (3.0.5) that integrates the shutters.

Then let's see if it is now working 😉

mbay0r commented 1 year ago

Nope 😂

mentor7785 commented 1 year ago

Update is installed - shutter are available but there is no position.

CyberDNS commented 1 year ago

Ok, can you paste the logs please.

mentor7785 commented 1 year ago

The first part of the log to initialize the shutter(s). I only copy one device from the log. If I interpret the log correctly, the shutter should be closed but that's not right.

[19:05:37 INF] Value for topic homeassistant/cover/lupusec/ZS_464301/state on device ZS:464301 - Rolladen WZ Tür Garten changed from null to closed [19:05:37 INF] Value for topic homeassistant/cover/lupusec/ZS_464301/position on device ZS:464301 - Rolladen WZ Tür Garten changed from null to 0

Then I want to change the position - I can see the command in the log, but nothing happens.

[19:56:10 INF] Command homeassistant/cover/lupusec/ZS_464301/set-pos of device ZS:464301 - Rolladen WZ Tür Garten executed with input 52

mbay0r commented 1 year ago
[00:13:59 INF] Device configured: ZS:5e4bxx - Rollladen
[00:13:59 INF] Command homeassistant/cover/lupusec/ZS_ae76xx/set registered for device ZS:ae76xx - Rollladen
[00:13:59 INF] Command homeassistant/cover/lupusec/ZS_ae76xx/set-pos registered for device ZS:ae76xx - Rollladen

[00:14:44 DBG] Response for POST https://192.168.x.x/action/haExecutePost:
Request:
Method: POST, RequestUri: 'https://192.168.x.x/action/haExecutePost', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
{
  Accept: application/json
  Authorization: Basic xxx
  X-Token: xxx
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 18
}
Response:
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: Mongoose
  Pragma: no-cache
  Cache-Control: no-cache
  Transfer-Encoding: chunked
  Expires: 0
  Content-Type: application/json; charset=utf-8
  Content-Length: 63
}
Response body:
RESULT_CODE: 0 MESSAGE: {WEB_ERR_PARAM_EMPTY}   exec
[00:14:44 INF] Command homeassistant/cover/lupusec/ZS_5e4bxx/set of device ZS:5e4bxx - Rollladen executed with input OPEN

[00:15:05 DBG] Response for POST https://192.168.x.x/action/haExecutePost:
Request:
Method: POST, RequestUri: 'https://192.168.x.x/action/haExecutePost', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
{
  Accept: application/json
  Authorization: Basic xxx
  X-Token: xxx
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 20
}
Response:
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: Mongoose
  Pragma: no-cache
  Cache-Control: no-cache
  Transfer-Encoding: chunked
  Expires: 0
  Content-Type: application/json; charset=utf-8
  Content-Length: 63
}
Response body:
RESULT_CODE: 0 MESSAGE: {WEB_ERR_PARAM_EMPTY}   exec
[00:15:05 INF] Command homeassistant/cover/lupusec/ZS_5e4bxx/set of device ZS:5e4bxx - Rollladen executed with input STOP
CyberDNS commented 1 year ago

And another version (3.0.6) has been pushed 😉

No with even more logging and a change in how the data is posted to lupusec system. I saw that in the case for haExecutePost they use some kind of double wrapped form encoding. So I tried to replicate that.

Let me know if we got a step further.

@mentor7785 : To have the debug logs enabled you have to set MinimumLogLevel in the options to Debug.

mbay0r commented 1 year ago

Now it seems to work. But I can currently only go up or stop. Down is grayed out, although the shutters are currently up.

So it does not seem to fetch the current status yet

}
Response body:
RESULT_CODE: 1 MESSAGE: {WEB_MSG_SUBMIT_SUCCESS}
[11:52:37 INF] Command homeassistant/cover/lupusec/ZS_5e4b01/set of device ZS:5e4b01 - Rollladen   executed with input OPEN
[11:52:37 DBG] Request for POST /action/haExecutePost:
Request:
Method: POST, RequestUri: '/action/haExecutePost', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
{
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 35
}
Request body:
exec=a%3D1%26z%3D6%26shutter%3Dstop
[11:52:38 DBG] Response for POST https://192.168.x.x/action/haExecutePost:
Response:
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: Mongoose
  Pragma: no-cache
  Cache-Control: no-cache
  Transfer-Encoding: chunked
  Expires: 0
  Content-Type: application/json; charset=utf-8
  Content-Length: 61
}
Response body:
RESULT_CODE: 1 MESSAGE: {WEB_MSG_SUBMIT_SUCCESS}
[11:52:38 INF] Command homeassistant/cover/lupusec/ZS_5e4b01/set of device ZS:5e4b01 - Rollladen executed with input STOP
[11:52:42 DBG] Request for POST /action/haExecutePost:
Request:
Method: POST, RequestUri: '/action/haExecutePost', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
{
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 35
}
Request body:
exec=a%3D1%26z%3D6%26shutter%3Dstop
[11:52:43 DBG] Response for POST https://192.168.x.x/action/haExecutePost:
Response:
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: Mongoose
  Pragma: no-cache
  Cache-Control: no-cache
  Transfer-Encoding: chunked
  Expires: 0
  Content-Type: application/json; charset=utf-8
  Content-Length: 61
}
Response body:
RESULT_CODE: 1 MESSAGE: {WEB_MSG_SUBMIT_SUCCESS}
[11:52:43 INF] Command homeassistant/cover/lupusec/ZS_5e4b01/set of device ZS:5e4b01 - Rollladen executed with input STOP
[11:52:44 DBG] Request for POST /action/haExecutePost:
Request:
Method: POST, RequestUri: '/action/haExecutePost', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
{
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 33
}
Request body:
exec=a%3D1%26z%3D6%26shutter%3Don
[11:52:45 DBG] Response for POST https://192.168.x.x/action/haExecutePost:
Response:
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: Mongoose
  Pragma: no-cache
  Cache-Control: no-cache
  Transfer-Encoding: chunked
  Expires: 0
  Content-Type: application/json; charset=utf-8
  Content-Length: 61
}
Response body:
RESULT_CODE: 1 MESSAGE: {WEB_MSG_SUBMIT_SUCCESS}
[11:52:45 INF] Command homeassistant/cover/lupusec/ZS_5e4b01/set of device ZS:5e4b01 - Rollladen executed with input OPEN
[11:52:47 DBG] Request for POST /action/haExecutePost:
Request:
Method: POST, RequestUri: '/action/haExecutePost', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
{
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 35
}
Request body:
exec=a%3D1%26z%3D6%26shutter%3Dstop
[11:52:48 DBG] Response for POST https://192.168.x.x/action/haExecutePost:
Response:
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: Mongoose
  Pragma: no-cache
  Cache-Control: no-cache
  Transfer-Encoding: chunked
  Expires: 0
  Content-Type: application/json; charset=utf-8
  Content-Length: 61
}
Response body:
RESULT_CODE: 1 MESSAGE: {WEB_MSG_SUBMIT_SUCCESS}
[11:52:48 INF] Command homeassistant/cover/lupusec/ZS_5e4b01/set of device ZS:5e4b01 - Rollladen executed with input STOP
CyberDNS commented 1 year ago

Ok good, we will also get the state to work. In which list you see the level changes, I am a little bit lost 😆.

I currently read the following lists:

An can you provide me json extract of the response payload where you see the level information.

mbay0r commented 1 year ago

i hope this will help:

Post Request on: https://192.168.178.27/action/deviceGet

{"area": 1, "zone": 6, "type": 76, "type_f": "{D_TYPE_76}", "name": "Rollladen Wohnzimmer Hof", 
"tag": "", 
"cond": "", "cond_ok": "1", "battery": "", "battery_ok": "1", 
"tamper": "", "tamper_ok": "1", "bypass": 0, "rssi": "{WEB_MSG_STRONG}  9", 
"resp_mode": [0,0,0,0,0,0], "ammeter": "0", "ver": "SCM-6-OTA_00.00.03.18TC", 
"bypass_tamper": 0, 
"sid": "ZS:5e4b01", "su": 1, "alarm_status": "", "status_ex": "0", "meta": "", "onOff": "1", "level": "100", "shutter_turn": "0", "manu": "ClimaxTechnology", "serial": "20200702        ", "profile": 260, "device": 512, "cluster": [2821,256,8,6,5,4,3,0], "ias_type": 0, "consumer_id": 0, "always_off": 0, "g_1": 1, "g_2": 0, "g_3": 0, "g_4": 0, "g_5": 0, "g_6": 0, "g_7": 0, "g_8": 0},

Level 100 is fully open Level 0 is fully closed

Danke !!

CyberDNS commented 1 year ago

Then I don't understand, that's what I am using.

Can you check if MQTT Explorer shows the changes and also every change should show up in the logs of the addon. And can you please do a test on the shutters manipulated from Lupusec and once when manipulated from HA.

image

[13:06:41 INF] Command homeassistant/cover/lupusec/ZS_4a2b01/set-pos of device ZS:4a2b01 - Rollladen Schlafzimmer executed with input 100
[13:10:08 INF] Value for topic homeassistant/cover/lupusec/ZS_4a2b01/state on device ZS:4a2b01 - Rollladen Schlafzimmer changed from open to closed
[13:10:08 INF] Value for topic homeassistant/cover/lupusec/ZS_4a2b01/position on device ZS:4a2b01 - Rollladen Schlafzimmer changed from 100 to 0
[13:10:14 INF] Value for topic homeassistant/cover/lupusec/ZS_4a2b01/state on device ZS:4a2b01 - Rollladen Schlafzimmer changed from closed to open
[13:10:14 INF] Value for topic homeassistant/cover/lupusec/ZS_4a2b01/position on device ZS:4a2b01 - Rollladen Schlafzimmer changed from 0 to 10
[13:10:17 INF] Value for topic homeassistant/cover/lupusec/ZS_4a2b01/position on device ZS:4a2b01 - Rollladen Schlafzimmer changed from 10 to 20
[13:10:22 INF] Value for topic homeassistant/cover/lupusec/ZS_4a2b01/position on device ZS:4a2b01 - Rollladen Schlafzimmer changed from 20 to 100
[13:10:29 INF] Value for topic homeassistant/cover/lupusec/ZS_4a2b01/state on device ZS:4a2b01 - Rollladen Schlafzimmer changed from open to closed
[13:10:30 INF] Value for topic homeassistant/cover/lupusec/ZS_4a2b01/position on device ZS:4a2b01 - Rollladen Schlafzimmer changed from 100 to 0
mbay0r commented 1 year ago

from mqtt:

image

when i go up or down in lupus, the status is updated in lupus but not in mqtt.

Addon Log is empty.

CyberDNS commented 1 year ago

Ok and if you do now request to https://192.168.178.27/action/deviceGet

You see the correct level in the payload?

CyberDNS commented 1 year ago

And you can set the LogLevel to Verbose, then you will get on every poll the values that are read from lupusec.

mbay0r commented 1 year ago

yes, it is changed.

{"area": 1, "zone": 6, "type": 76, "type_f": "{D_TYPE_76}", "name": "Rollladen Wohnzimmer", 
"tag": "", 
"cond": "", "cond_ok": "1", "battery": "", "battery_ok": "1", 
"tamper": "", "tamper_ok": "1", "bypass": 0, "rssi": "{WEB_MSG_STRONG}  9", 
"resp_mode": [0,0,0,0,0,0], "ammeter": "0", "ver": "SCM-6-OTA_00.00.03.18TC", 
"bypass_tamper": 0, 
"sid": "ZS:5e4b01", "su": 1, "alarm_status": "", "status_ex": "0", "meta": "", "onOff": "1", "level": "4", "shutter_turn": "0", "manu": "ClimaxTechnology", "serial": "20200702        ", "profile": 260, "device": 512, "cluster": [2821,256,8,6,5,4,3,0], "ias_type": 0, "consumer_id": 0, "always_off": 0, "g_1": 1, "g_2": 0, "g_3": 0, "g_4": 0, "g_5": 0, "g_6": 0, "g_7": 0, "g_8": 0},

shutter is closed now.

mbay0r commented 1 year ago

in mqtt explorer still no changes.

mbay0r commented 1 year ago
[14:24:49 VRB] Querying values for ZS:5e4b01 - Rollladen Wohnzimmer 
on topic homeassistant/cover/lupusec/ZS_5e4b01/state => closed
[14:24:49 VRB] Querying values for ZS:5e4b01 - Rollladen Wohnzimmer 
on topic homeassistant/cover/lupusec/ZS_5e4b01/position => 0

nothing more with Verbose.

CyberDNS commented 1 year ago

Ok, I will put even more logging to understand this.

CyberDNS commented 1 year ago

With a little bit of chance I found the bug, I pushed a new version that contains even more logging. If you set the LogLevel to Verbose, you will get the complete message delivered by lupusec.

Version is 3.0.7

mbay0r commented 1 year ago
[15:15:43 ERR] Error during poll execution!
System.NullReferenceException: Object reference not set to an instance of an object.
   at Lupusec2Mqtt.Mqtt.Homeassistant.Devices.Cover.GetPosition(ILogger logger, ILupusecService lupusecService) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Mqtt/Homeassistant/Devices/Cover.cs:line 44
   at Lupusec2Mqtt.MainLoop.DoWork(Object state) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/MainLoop.cs:line 96

still not working. :-(