giejay / domoticz-gbridge-plugin

Domoticz plugin for the Kappelt gBridge
16 stars 4 forks source link

gBridge plug-in does not create devices (updated topic name) #7

Closed Domot closed 5 years ago

Domot commented 5 years ago

Hi Gert-Jan,

After syncing my device in Google Home, Domoticz reports a problem in the logfile:

2019-02-21 21:43:41.326 Error: (gBridgeRemote): Async Secure Read Exception: 1, stream truncated 2019-02-21 21:43:42.774 Error: (gBridgeRemote) The server couldn't fulfill the request: Fetching all devices from gBridge. 2019-02-21 21:43:42.775 Error: (gBridgeRemote) Error code: 401, reason: Unauthorized 2019-02-21 21:43:42.775 Error: (gBridgeRemote) 'onStart' failed 'HTTPError'. 2019-02-21 21:43:42.775 Error: (gBridgeRemote) ----> Line 157 in /home/pi/domoticz/plugins/domoticz-gbridge-plugin/plugin.py, function onStart 2019-02-21 21:43:42.775 Error: (gBridgeRemote) ----> Line 71 in /home/pi/domoticz/plugins/domoticz-gbridge-plugin/plugin.py, function onStart 2019-02-21 21:43:42.775 Error: (gBridgeRemote) ----> Line 77 in /home/pi/domoticz/plugins/domoticz-gbridge-plugin/plugin.py, function syncDevices 2019-02-21 21:43:42.775 Error: (gBridgeRemote) ----> Line 53 in /home/pi/domoticz/plugins/domoticz-gbridge-plugin/gbridge_client.py, function fetchDevicesFromBridge 2019-02-21 21:43:42.775 Error: (gBridgeRemote) ----> Line 68 in /home/pi/domoticz/plugins/domoticz-gbridge-plugin/gbridge_client.py, function callAPI 2019-02-21 21:43:42.776 Error: (gBridgeRemote) ----> Line 163 in /usr/lib/python3.5/urllib/request.py, function urlopen 2019-02-21 21:43:42.776 Error: (gBridgeRemote) ----> Line 472 in /usr/lib/python3.5/urllib/request.py, function open 2019-02-21 21:43:42.776 Error: (gBridgeRemote) ----> Line 582 in /usr/lib/python3.5/urllib/request.py, function http_response 2019-02-21 21:43:42.776 Error: (gBridgeRemote) ----> Line 510 in /usr/lib/python3.5/urllib/request.py, function error 2019-02-21 21:43:42.776 Error: (gBridgeRemote) ----> Line 444 in /usr/lib/python3.5/urllib/request.py, function _call_chain 2019-02-21 21:43:42.776 Error: (gBridgeRemote) ----> Line 590 in /usr/lib/python3.5/urllib/request.py, function http_error_default 2019-02-21 21:46:34.741 Error: (gBridgeRemote) 'onMessage' failed 'TypeError':'argument of type 'NoneType' is not iterable'. 2019-02-21 21:46:34.741 Error: (gBridgeRemote) ----> Line 178 in /home/pi/domoticz/plugins/domoticz-gbridge-plugin/plugin.py, function onMessage 2019-02-21 21:46:34.741 Error: (gBridgeRemote) ----> Line 100 in /home/pi/domoticz/plugins/domoticz-gbridge-plugin/plugin.py, function onMessage 2019-02-21 21:46:34.741 Error: (gBridgeRemote) ----> Line 126 in /home/pi/domoticz/plugins/domoticz-gbridge-plugin/mqtt.py, function onMessage 2019-02-21 21:46:34.741 Error: (gBridgeRemote) ----> Line 135 in /home/pi/domoticz/plugins/domoticz-gbridge-plugin/plugin.py, function onMQTTPublish

Looks that it has something related to authorization. Do you have any suggestions for me?

image

Richard

giejay commented 5 years ago

Hi,

If you go to: https://gbridge.kappelt.net/api/device and use the exact same credentials as you specified in gBridge username and.password. Do you see your devices?

giejay commented 5 years ago

Btw, you have specified the Domoticz port to be 1883, are you sure about that? Shouldnt that be 8080 or did you actually change it to 1883?

Domot commented 5 years ago

This is what it shows:

[{"device_id":2154,"name":"Lamp_voor","user_id":785,"devicetype_id":1,"twofa_type":null,"twofa_pin":null}]

You are right, domoticz port is 8080 and not my MQTT port of course.

Changed this but still no good result. I will try to repeat the setup in GHome and GBridge.

giejay commented 5 years ago

Are there any strange characters in your password and if so, could you replace those and try again?

Domot commented 5 years ago

I was almost at the point of succes:

2019-02-23 10:44:46.999 Status: User: familie initiated a switch command (14/Lamp hang/On)

It seems that gBridge had an issue because when I add a device, it responds with Device Added Sucessfully but after refreshing browser is has disappeared all set to zero devices.

I still have the free subscription.

giejay commented 5 years ago

Did you manually add the device? Then it could be that the plugin deleted it again because you set 'delete devices' to true

Domot commented 5 years ago

No only the hardware gBridge in Domoticz. gBridge is stable now.

This is the log: 2019-02-23 13:51:46.958 (gBridgeRemote) Message from base 2019-02-23 13:51:46.959 (gBridgeRemote) Incoming message!{'DUP': 0, 'Topic': 'gBridge/u785/d0/grequest', 'Retain': False, 'Payload': b'EXECUTE', 'QoS': 0, 'Verb': 'PUBLISH'} 2019-02-23 13:51:46.959 (gBridgeRemote) MQTT message: gBridge/u785/d0/grequest EXECUTE 2019-02-23 13:51:46.959 (gBridgeRemote) Received message for device which is not in Domoticz: d0, skipping 2019-02-23 13:51:46.960 (gBridgeRemote) Message from base 2019-02-23 13:51:46.960 (gBridgeRemote) Incoming message!{'DUP': 0, 'Topic': 'gBridge/u785/d2269/onoff', 'Retain': False, 'Payload': b'1', 'QoS': 0, 'Verb': 'PUBLISH'} 2019-02-23 13:51:46.960 (gBridgeRemote) MQTT message: gBridge/u785/d2269/onoff 1 2019-02-23 13:51:46.960 (gBridgeRemote) Received message for device which is not in Domoticz: d2269, skipping

giejay commented 5 years ago

Did you let the plugin create the device in gBridge? Or did you manually add the device? Whats in your device description of the device you want to control.

Domot commented 5 years ago

The plug-in does not create devices and I did not create them manually. The device description is “Lamp voor”.

giejay commented 5 years ago

You mean, gBridge:Lamp voor?

Domot commented 5 years ago

No only Lamp voor. Does it need gBridge: as identifier?

giejay commented 5 years ago

Yes, please check the section Configure Devices in the readme.

Domot commented 5 years ago

I have tried these opties now: [{"device_id":2281,"name":"Description: gBridge:Lamp","user_id":785,"devicetype_id":1,"twofa_type":null,"twofa_pin":null},{"device_id":2283,"name":"gBridge:Verlichting","user_id":785,"devicetype_id":3,"twofa_type":null,"twofa_pin":null}]

But not creating Devices in Domoticz

giejay commented 5 years ago

Did you update the hardware?

Domot commented 5 years ago

Yes I did.

This is the log output in Domoticz:

2019-02-24 14:16:28.679 (gBridgeRemote) Received 35 bytes of data 2019-02-24 14:16:28.680 (gBridgeRemote) 30 21 00 18 67 42 72 69 64 67 65 2f 75 37 38 35 2f 64 30 2f 0!..gBridge/u785/d0/ 2019-02-24 14:16:28.680 (gBridgeRemote) 67 72 65 71 75 65 73 74 45 58 45 43 55 54 45 .. .. .. .. .. grequestEXECUTE 2019-02-24 14:16:28.680 (gBridgeRemote) Received 29 bytes of data 2019-02-24 14:16:28.680 (gBridgeRemote) 30 1b 00 18 67 42 72 69 64 67 65 2f 75 37 38 35 2f 64 32 32 0...gBridge/u785/d22 2019-02-24 14:16:28.680 (gBridgeRemote) 38 33 2f 6f 6e 6f 66 66 31 .. .. .. .. .. .. .. .. .. .. .. 83/onoff1 2019-02-24 14:16:28.680 (gBridgeRemote) Message from base 2019-02-24 14:16:28.680 (gBridgeRemote) Incoming message!{'DUP': 0, 'Retain': False, 'Payload': b'EXECUTE', 'Topic': 'gBridge/u785/d0/grequest', 'Verb': 'PUBLISH', 'QoS': 0} 2019-02-24 14:16:28.681 (gBridgeRemote) MQTT message: gBridge/u785/d0/grequest EXECUTE 2019-02-24 14:16:28.681 (gBridgeRemote) Received message for device which is not in Domoticz: d0, skipping 2019-02-24 14:16:28.681 (gBridgeRemote) Message from base 2019-02-24 14:16:28.681 (gBridgeRemote) Incoming message!{'DUP': 0, 'Retain': False, 'Payload': b'1', 'Topic': 'gBridge/u785/d2283/onoff', 'Verb': 'PUBLISH', 'QoS': 0} 2019-02-24 14:16:28.682 (gBridgeRemote) MQTT message: gBridge/u785/d2283/onoff 1 2019-02-24 14:16:28.682 (gBridgeRemote) Received message for device which is not in Domoticz: d2283, skipping 2019-02-24 14:16:34.494 (gBridgeRemote) Heartbeating... 2019-02-24 14:16:34.497 (gBridgeRemote) MqttClient::Ping 2019-02-24 14:16:34.501 (gBridgeRemote) Sending 2 bytes of data 2019-02-24 14:16:34.504 (gBridgeRemote) c0 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �. 2019-02-24 14:16:34.554 (gBridgeRemote) Received 2 bytes of data 2019-02-24 14:16:34.555 (gBridgeRemote) d0 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �. 2019-02-24 14:16:34.555 (gBridgeRemote) Message from base 2019-02-24 14:16:34.555 (gBridgeRemote) Incoming message!{'Verb': 'PINGRESP'} 2019-02-24 14:16:44.536 (gBridgeRemote) Heartbeating... 2019-02-24 14:16:44.539 (gBridgeRemote) MqttClient::Ping 2019-02-24 14:16:44.541 (gBridgeRemote) Sending 2 bytes of data 2019-02-24 14:16:44.543 (gBridgeRemote) c0 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �. 2019-02-24 14:16:44.595 (gBridgeRemote) Received 2 bytes of data 2019-02-24 14:16:44.598 (gBridgeRemote) d0 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �. 2019-02-24 14:16:44.598 (gBridgeRemote) Message from base 2019-02-24 14:16:44.598 (gBridgeRemote) Incoming message!{'Verb': 'PINGRESP'}

giejay commented 5 years ago

What is the initial logging, which shows which devices are being created, after clicking the update button on the hardware page?

Domot commented 5 years ago

I have masked **** the MQTT password in the data below.

2019-02-24 19:50:09.350 (gBridgeRemote) Disconnect directive received for 'mqtt.gbridge.kappelt.net:8883'. 2019-02-24 19:50:09.350 (gBridgeRemote) Handling disconnect, socket (mqtt.gbridge.kappelt.net:8883) is connected 2019-02-24 19:50:09.350 (gBridgeRemote) Queued asyncronous secure read aborted. 2019-02-24 19:50:09.400 (gBridgeRemote) Disconnect event received for 'mqtt.gbridge.kappelt.net:8883'. 2019-02-24 19:50:09.401 (gBridgeRemote) MqttClient::onDisonnect Disconnected from: mqtt.gbridge.kappelt.net:8883 2019-02-24 19:50:09.401 (gBridgeRemote) MqttClient::Close 2019-02-24 19:50:09.401 (gBridgeRemote) onMQTTDisconnected 2019-02-24 19:50:09.401 (gBridgeRemote) Deallocating connection object 'mqtt.gbridge.kappelt.net' (mqtt.gbridge.kappelt.net:8883). 2019-02-24 19:50:09.401 (gBridgeRemote) onStop called 2019-02-24 19:50:09.326 Status: (gBridgeRemote) Stop directive received. 2019-02-24 19:50:09.526 Status: (gBridgeRemote) Stopping threads. 2019-02-24 19:50:09.622 Status: (gBridgeRemote) Exiting work loop. 2019-02-24 19:50:09.623 Status: (gBridgeRemote) Stopped. 2019-02-24 19:51:08.436 Status: (gBridgeRemote) Started. 2019-02-24 19:51:09.321 (gBridgeRemote) Debug logging mask set to: PYTHON PLUGIN DEVICE CONNECTION MESSAGE 2019-02-24 19:51:09.321 (gBridgeRemote) onStart called 2019-02-24 19:51:09.321 (gBridgeRemote) MqttClient::init 2019-02-24 19:51:09.321 (gBridgeRemote) MqttClient::Open 2019-02-24 19:51:09.322 (gBridgeRemote) gBridgeClient::init 2019-02-24 19:51:09.322 (gBridgeRemote) DomoticzClient::init 2019-02-24 19:51:09.322 (gBridgeRemote) Starting sync 2019-02-24 19:51:09.327 (gBridgeRemote) Calling API for action: Fetching all devices from gBridge, url: https://gbridge.kappelt.net/api/device 2019-02-24 19:51:09.544 (gBridgeRemote) Successfully executed action: Fetching all devices from gBridge, response: [{"device_id":2283,"name":"Description: gBridge:Lampje","user_id":785,"devicetype_id":3,"twofa_type":null,"twofa_pin":null}] 2019-02-24 19:51:09.590 (gBridgeRemote) Domoticz devices available for gBridge: dict_keys([]) 2019-02-24 19:51:09.591 (gBridgeRemote) Done 2019-02-24 19:51:09.591 (gBridgeRemote) Protocol set to: 'MQTTS'. 2019-02-24 19:51:09.591 (gBridgeRemote) Transport set to: 'TCP/IP', mqtt.gbridge.kappelt.net:8883. 2019-02-24 19:51:09.604 (gBridgeRemote) Connect directive received, action initiated successfully. 2019-02-24 19:51:09.704 (gBridgeRemote) onConnect called 2019-02-24 19:51:09.704 (gBridgeRemote) MQTT connected !!!!successfully. 2019-02-24 19:51:09.705 (gBridgeRemote) MqttClient::Connect 2019-02-24 19:51:09.705 (gBridgeRemote) MQTT CONNECT ID: 'Domoticz_1551034269' 2019-02-24 19:51:09.705 (gBridgeRemote) Sending 57 bytes of data 2019-02-24 19:51:09.705 (gBridgeRemote) 10 37 00 04 4d 51 54 54 04 c2 00 3c 00 13 44 6f 6d 6f 74 69 .7..MQTT.�.<..Domoti 2019-02-24 19:51:09.705 (gBridgeRemote) 63 7a 5f 31 35 35 31 30 33 34 32 36 39 00 0c 67 62 72 69 64 cz_1551034269..gbrid 2019-02-24 19:51:09.705 (gBridgeRemote) 67 65 2d 75 37 38 35 00 08 41 61 72 6f 6e 32 32 41 .. .. .. ge-u785..**** 2019-02-24 19:51:09.756 (gBridgeRemote) Received 4 bytes of data 2019-02-24 19:51:09.756 (gBridgeRemote) 20 02 00 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .... 2019-02-24 19:51:09.756 (gBridgeRemote) Message from base 2019-02-24 19:51:09.756 (gBridgeRemote) Incoming message!{'Description': 'Connection Accepted', 'Status': 0, 'Verb': 'CONNACK'} 2019-02-24 19:51:09.756 (gBridgeRemote) MqttClient::Subscribe['gBridge/u785/#'] 2019-02-24 19:51:09.757 (gBridgeRemote) Sending 21 bytes of data 2019-02-24 19:51:09.757 (gBridgeRemote) 82 13 00 01 00 0e 67 42 72 69 64 67 65 2f 75 37 38 35 2f 23 �.....gBridge/u785/# 2019-02-24 19:51:09.757 (gBridgeRemote) 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . 2019-02-24 19:51:09.807 (gBridgeRemote) Received 5 bytes of data 2019-02-24 19:51:09.808 (gBridgeRemote) 90 03 00 01 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �.... 2019-02-24 19:51:09.808 (gBridgeRemote) Message from base 2019-02-24 19:51:09.808 (gBridgeRemote) Incoming message!{'Topics': [{'Description': 'Success - Maximum QoS 0', 'Status': 0}], 'PacketIdentifier': 1, 'Verb': 'SUBACK'} 2019-02-24 19:51:09.808 (gBridgeRemote) onMQTTSubscribed 2019-02-24 19:51:09.266 Status: (gBridgeRemote) Entering work loop. 2019-02-24 19:51:09.267 Status: (gBridgeRemote) Initialized version 0.0.14 2019-02-24 19:51:18.781 (gBridgeRemote) Heartbeating... 2019-02-24 19:51:18.783 (gBridgeRemote) MqttClient::Ping 2019-02-24 19:51:18.786 (gBridgeRemote) Sending 2 bytes of data 2019-02-24 19:51:18.788 (gBridgeRemote) c0 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �. 2019-02-24 19:51:18.840 (gBridgeRemote) Received 2 bytes of data 2019-02-24 19:51:18.841 (gBridgeRemote) d0 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �. 2019-02-24 19:51:18.841 (gBridgeRemote) Message from base 2019-02-24 19:51:18.841 (gBridgeRemote) Incoming message!{'Verb': 'PINGRESP'} 2019-02-24 19:51:28.810 (gBridgeRemote) Heartbeating... 2019-02-24 19:51:28.810 (gBridgeRemote) MqttClient::Ping 2019-02-24 19:51:28.810 (gBridgeRemote) Sending 2 bytes of data 2019-02-24 19:51:28.810 (gBridgeRemote) c0 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �. 2019-02-24 19:51:28.861 (gBridgeRemote) Received 2 bytes of data 2019-02-24 19:51:28.861 (gBridgeRemote) d0 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �. 2019-02-24 19:51:28.861 (gBridgeRemote) Message from base 2019-02-24 19:51:28.861 (gBridgeRemote) Incoming message!{'Verb': 'PINGRESP'} 2019-02-24 19:51:38.777 (gBridgeRemote) Heartbeating... 2019-02-24 19:51:38.777 (gBridgeRemote) MqttClient::Ping 2019-02-24 19:51:38.777 (gBridgeRemote) Sending 2 bytes of data 2019-02-24 19:51:38.777 (gBridgeRemote) c0 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �.

giejay commented 5 years ago

If you now say to Google, Sync my devices followed by 'turn on lampje' of 'zet lampje aan', then I think it should work.

Domot commented 5 years ago

It does not respond. When I remove the gBridge hardware and add it again it gives the pop up that devices are created. But they are not. I believe that the loop between gBridge and Google Home works fine now. Something is going wrong in the plug-in I think.

giejay commented 5 years ago

What do you mean that the devices are not created? I see in the log that the device is created in gBridge. You don't need to remove the hardware, just selecting gBridge in the hardware and clicking update should be enough. Does the device also not appear in your google home app?

Domot commented 5 years ago

Is there another way to add devices manually related to gBridge hardware type in Domoticz? Devices are not added after adding or updating gBridge. In the log: (gBridge) Received message for device which is not in Domoticz: d2353, skipping

Is it maybe an option to create a button in the hardware page “create virtual sensors”

giejay commented 5 years ago

I think thers a misunderstanding in how you think the plugin works. Devices won't be created in Domoticz since all your devices are already in Domoticz like 'Lamp'.

So the only thing you have to do, is mark those devices, using the description with 'gBridge'. Then it will automatically create the devices in gBridge. In theory you will never have to go the interface in gBridge, perhaps just for checking if all devices are present.

Domot commented 5 years ago

I think I was too. I've read your readme three times again and with your last post I understand that your plug-in should do all the work. What I did now is changing an existing device description with Description: gBridge:GiveItAName like: image image

... but it does even less as the other wrong way around. Before I executed this I deleted the hardware, deleted the devices in gBridge account, lunlinked GH account, restarted Domoticz Service.

This is the log output when starting up: 2019-02-26 23:01:49.945 Status: (gBridgeHome) Started. 2019-02-26 23:01:50.881 (gBridgeHome) Debug logging mask set to: PYTHON PLUGIN DEVICE CONNECTION MESSAGE 2019-02-26 23:01:50.881 (gBridgeHome) onStart called 2019-02-26 23:01:50.881 (gBridgeHome) MqttClient::init 2019-02-26 23:01:50.882 (gBridgeHome) MqttClient::Open 2019-02-26 23:01:50.882 (gBridgeHome) gBridgeClient::init 2019-02-26 23:01:50.882 (gBridgeHome) DomoticzClient::init 2019-02-26 23:01:50.882 (gBridgeHome) Starting sync 2019-02-26 23:01:50.887 (gBridgeHome) Calling API for action: Fetching all devices from gBridge, url: https://gbridge.kappelt.net/api/device 2019-02-26 23:01:50.826 Status: (gBridgeHome) Entering work loop. 2019-02-26 23:01:50.827 Status: (gBridgeHome) Initialized version 0.0.14 2019-02-26 23:01:51.160 (gBridgeHome) Successfully executed action: Fetching all devices from gBridge, response: [] 2019-02-26 23:01:51.205 (gBridgeHome) Domoticz devices available for gBridge: dict_keys([]) 2019-02-26 23:01:51.206 (gBridgeHome) Done 2019-02-26 23:01:51.206 (gBridgeHome) Protocol set to: 'MQTTS'. 2019-02-26 23:01:51.206 (gBridgeHome) Transport set to: 'TCP/IP', mqtt.gbridge.kappelt.net:8883. 2019-02-26 23:01:51.214 (gBridgeHome) Connect directive received, action initiated successfully. 2019-02-26 23:01:51.315 (gBridgeHome) onConnect called 2019-02-26 23:01:51.315 (gBridgeHome) MQTT connected !!!!successfully. 2019-02-26 23:01:51.315 (gBridgeHome) MqttClient::Connect 2019-02-26 23:01:51.315 (gBridgeHome) MQTT CONNECT ID: 'Domoticz_1551218511' 2019-02-26 23:01:51.315 (gBridgeHome) Sending 57 bytes of data 2019-02-26 23:01:51.315 (gBridgeHome) 10 37 00 04 4d 51 54 54 04 c2 00 3c 00 13 44 6f 6d 6f 74 69 .7..MQTT.�.<..Domoti 2019-02-26 23:01:51.316 (gBridgeHome) 63 7a 5f 31 35 35 31 32 31 38 35 31 31 00 0c 67 62 72 69 64 cz_1551218511..gbrid 2019-02-26 23:01:51.316 (gBridgeHome) 67 65 2d 75 37 38 35 00 08 41 61 72 6f 6e 32 32 41 .. .. .. ge-u785..masked password 2019-02-26 23:01:51.366 (gBridgeHome) Received 4 bytes of data 2019-02-26 23:01:51.366 (gBridgeHome) 20 02 00 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .... 2019-02-26 23:01:51.367 (gBridgeHome) Message from base 2019-02-26 23:01:51.367 (gBridgeHome) Incoming message!{'Description': 'Connection Accepted', 'Status': 0, 'Verb': 'CONNACK'} 2019-02-26 23:01:51.367 (gBridgeHome) MqttClient::Subscribe['gBridge/u785/#']

Other options in description I tried: Description:gBridge:Lamp_hang Description: gBridge:Lamp_hang Description: gBridge: Lamp_hang Description:gBridge: Lamp_hang gBridge:Lamp_hang gBridge: Lamp_hang

I'm really out of options now. What do I really wrong ?!

Domot commented 5 years ago

Yes finally I've got it working It's not the name but the field below (which is actually the real translation for Omschrijving). image So your plug-in works like a charm, thank you very much for the support and patience. I hope this topic helps other future users. I think it's a good suggestion to add this little picture in your readme.

giejay commented 5 years ago

You are not the first one to use the name instead of the description so I will make sure to add your picture to the readme, thanks!

geertvercamer commented 4 years ago

sorry to be a pain, but I have a similar problem: no device is created in gBridge although I've added the 'gBridge:Airco' text in the description field.

In Domoticz log: 019-09-03 23:09:07.091 Error: (gBridge) No gBridge adapter found for device: {'AddjMulti': 1.0, 'AddjMulti2': 1.0, 'AddjValue': 0.0, 'AddjValue2': 0.0, 'BatteryLevel': 255, 'CustomImage': 9, 'Data': 'Off', 'Description': 'gBridge:Airco', 'DimmerType': 'none', 'Favorite': 0, 'HardwareID': 15, 'HardwareName': 'MELcloud', 'HardwareType': 'MELCloud plugin', 'HardwareTypeVal': 94, 'HaveDimmer': True, 'HaveGroupCmd': True, 'HaveTimeout': False, 'ID': '000F0008', 'Image': 'Generic', 'IsSubDevice': False, 'LastUpdate': '2019-09-03 23:09:04', 'Level': 0, 'LevelActions': 'fHx8fA==', 'LevelInt': 0, 'LevelNames': 'T2ZmfFdhcm18Q29sZHxWZW50fERyeQ==', 'LevelOffHidden': False, 'MaxDimLevel': 100, 'Name': 'MELcloud - Kamer Geert - Mode', 'Notifications': 'false', 'PlanID': '7', 'PlanIDs': [7], 'Protected': False, 'SelectorStyle': 1, 'ShowNotifications': True, 'SignalLevel': '-', 'Status': 'Off', 'StrParam1': '', 'StrParam2': '', 'SubType': 'Selector Switch', 'SwitchType': 'Selector', 'SwitchTypeVal': 18, 'Timers': 'false', 'Type': 'Light/Switch', 'TypeImg': 'Light', 'Unit': 8, 'Used': 1, 'UsedByCamera': False, 'XOffset': '631', 'YOffset': '383', 'idx': '116'}

Could the reason be that this device (Mitsubishi Airco using MELcloud) has specific traits that gBridge can't recognise?

Thanks.

KR

Geert

giejay commented 4 years ago

That is correct, airco's are not supported, at least in this gBridge adapter

geertvercamer commented 4 years ago

Then why do I read in the documentation on https://doc.gbridge.io/traits/onoff.html Fitting device types https://doc.gbridge.io/traits/onoff.html#fitting-device-types

These device types could be combined well with this trait:

-

Air Conditioners

???

Met vriendelijke groet,

Geert

On Wed, 4 Sep 2019 at 07:24, GJ Compagner notifications@github.com wrote:

That is correct, airco's are not supported, at least in this gBridge adapter

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/giejay/domoticz-gbridge-plugin/issues/7?email_source=notifications&email_token=ACWNUZLXD22V4OJHVUMUKDTQH5A65A5CNFSM4GZBISA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD52MBKA#issuecomment-527745192, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWNUZI57YBQ4RX22GICP5LQH5A65ANCNFSM4GZBISAQ .

giejay commented 4 years ago

That's why I added: "at least in this gBridge adapter" ;) Everything that gBridge supports, has to be manually added to this domoticz adapter. Airco's are not added until now. I will add OnOff for "Selector" types as I see that your Airco has: 'SwitchType': 'Selector', and hope that works. Can't test it myself because I dont have an airco (unfortunately).

I just pushed a commit to develop which should help you out, can you try?

geertvercamer commented 4 years ago

oh, OK. My bad, still have to learn lot,

I don't know, maybe every airco has different way of working. I think there is not really an on/off switch in my case. The airco is activated by setting a 'level' to cold/heat/dry/... To complicate things, that has to be translated to a number. I don't know them by heart, but 'cold' = 20, 'off' = 0

I'll try to test it as soon as possible, when you have implemented that. Cheers,

Geert

On Wed, 4 Sep 2019 at 08:29, GJ Compagner notifications@github.com wrote:

That's why I added: "at least in this gBridge adapter" ;) Everything that gBridge supports, has to be manually added to this domoticz adapter. Airco's are not added until now. I will add OnOff for "Selector" types as I see that your Airco has: 'SwitchType': 'Selector', and hope that works. Can't test it myself because I dont have an airco (unfortunately).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/giejay/domoticz-gbridge-plugin/issues/7?email_source=notifications&email_token=ACWNUZI6FQ6YASXONWBL543QH5IUBA5CNFSM4GZBISA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD52QCRA#issuecomment-527761732, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWNUZKYH6ZQ7YD47VZO43TQH5IUBANCNFSM4GZBISAQ .

giejay commented 4 years ago

That seems really specific per Airco. Seeing as Im not using Domoticz anymore (moved to OpenHab), and therefore also not using this plugin anymore, I won't be supporting that specific use case. You could try to implement the adapter yourself, or create a Dummy Switch, turn on/off the Dummy Switch using gBridge/Google Home and make a dzVents rule which turns the Airco Selector on, based on the Dummy Switch value.

geertvercamer commented 4 years ago

I'll try to test it soon... Instead, I tried the main version with a on/off switch and I can confirm that works just fine. I may go for the dummy switch option. Had a quick look to the adapter code as well. This is completely new for me. It may be better to make it similar to the DimmableAdapter, as the MELCloud is all about setting levels instead of on/off... I'll see. Thanks for your effort and quick responses!