so if I understand well, for this specific matter (using a laptop) WMI works better than ctypes ? Because with WMI not only I can get the current brightness level, I can also set it to whatever I like. Well anyway, we can continue this conversation on the other topic, we are off topic !
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
MQTT Client
Re: MQTT Client
yes i'm using a laptop, I mentioned it a few posts earlier 
so if I understand well, for this specific matter (using a laptop) WMI works better than ctypes ? Because with WMI not only I can get the current brightness level, I can also set it to whatever I like. Well anyway, we can continue this conversation on the other topic, we are off topic !
(sorry MQTT ) 
so if I understand well, for this specific matter (using a laptop) WMI works better than ctypes ? Because with WMI not only I can get the current brightness level, I can also set it to whatever I like. Well anyway, we can continue this conversation on the other topic, we are off topic !
Re: MQTT Client
same
i use pc with tv as monitor
and i use program volume2 which can control brightness with hotkeys
Code: Select all
Python Script
Traceback (most recent call last):
Python script "16", line 104, in <module>
raise ctypes.WinError()
WindowsError: [Error 31] \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0435 \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.and i use program volume2 which can control brightness with hotkeys
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: MQTT Client
It depends on how the brightness is being set.
WMI could very well be altering the output stream from the video card. and not setting the actual brightness level of the screen. there is a very large difference.
The only way you would be able to know is if you had EG draw a completely black box that filled the entire screen and then changed the brightness. if the "glow" doesn't diminish then WMI is not setting the brightness but it is altering the video stream.
I do not know that innerworkings of windows to know who does what and why. or even if that function that i found works. The fact that it states that it uses an i2c data lane make me wonder if it in fact will work on a screen.
The way I am going about it is not using WMI and nor is it using that function. I am using a specific function for sending raw codes to a screen. There is so much that is broken in Windows who knows what does and does not work properly.
give me a few moments to put together a quick and dirty to test the mechanism I am going to use,
WMI could very well be altering the output stream from the video card. and not setting the actual brightness level of the screen. there is a very large difference.
The only way you would be able to know is if you had EG draw a completely black box that filled the entire screen and then changed the brightness. if the "glow" doesn't diminish then WMI is not setting the brightness but it is altering the video stream.
I do not know that innerworkings of windows to know who does what and why. or even if that function that i found works. The fact that it states that it uses an i2c data lane make me wonder if it in fact will work on a screen.
The way I am going about it is not using WMI and nor is it using that function. I am using a specific function for sending raw codes to a screen. There is so much that is broken in Windows who knows what does and does not work properly.
give me a few moments to put together a quick and dirty to test the mechanism I am going to use,
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: MQTT Client
@Terr
i forgot to go and buy a box of lucky charms. to get the free decoder ring prize so i can decode that error message. LOL
You either have to give me the language you have your computer set to so I can decode that bugger. or if you want to change the language you have windows set to then rerun it so we get an error output in english.
I find it odd that it is output that way because the error messages are gotten from Windows it's self. which would be translated into the current locale windows is set to. do you have EG set differently then Windows as far as the language goes?
i forgot to go and buy a box of lucky charms. to get the free decoder ring prize so i can decode that error message. LOL
You either have to give me the language you have your computer set to so I can decode that bugger. or if you want to change the language you have windows set to then rerun it so we get an error output in english.
I find it odd that it is output that way because the error messages are gotten from Windows it's self. which would be translated into the current locale windows is set to. do you have EG set differently then Windows as far as the language goes?
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: MQTT Client
I am going to move over into the other thread where this conversation is better suited.
-
kalinkamaen
- Experienced User
- Posts: 138
- Joined: Wed Dec 26, 2012 9:23 am
Re: MQTT Client
Hello guys.
Mqtt with Domoticz. When I am pushing a scene in domoticz, the mqtt stops logging in EG.
Mqtt with Domoticz. When I am pushing a scene in domoticz, the mqtt stops logging in EG.
Code: Select all
Exception in thread domoticz/out:
Traceback (most recent call last):
File "threading.pyc", line 532, in __bootstrap_inner
File "C:\EventGhost\plugins\MQTT Client\__init__.py", line 439, in run
lrsp = mqttc.loop(10.0, 1)
File "C:\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 824, in loop
rc = self.loop_read(max_packets)
File "C:\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 1086, in loop_read
rc = self._packet_read()
File "C:\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 1488, in _packet_read
rc = self._packet_handle()
File "C:\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 1956, in _packet_handle
return self._handle_publish()
File "C:\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 2131, in _handle_publish
self._handle_on_message(message)
File "C:\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 2287, in _handle_on_message
self.on_message(self, self._userdata, message)
File "C:\EventGhost\plugins\MQTT Client\__init__.py", line 323, in on_message
res_key = msg.topic + ', ' + str(result[4])
IndexError: list index out of rangeRe: MQTT Client
Thanks a lot for thatkgschlosser wrote: Wed Jul 11, 2018 10:06 pm ....
Because of the complex nature of MQTT the author decided to put the message information into a payload. We can greatly improve upon this if you wanted. What can be done is you would create a Macro that has a python script action in it.
In that python script paste the following code
then drag and drop one of your events. double click on the event in your tree and change it to the following.Code: Select all
payload = eg.event.payload if payload and isinstance(payload, (str, unicode)) and 'suffix' in payload: payload = payload.split('suffix=') suffix = payload[1].strip() if 'prefix' in payload[0]: payload = payload[0].split('prefix=') prefix = payload[1].strip() elif 'prefix' in suffix: suffix = suffix.split('prefix=') prefix = suffix[1].strip() suffix = suffix[0].strip() else: prefix = eg.event.string if 'payload' in payload[0]: payload = payload[0].split('payload=') payload = payload[1].strip() elif 'payload' in prefix: prefix = prefix.split('payload=') payload = prefix[1].strip() prefix = prefix[0].strip() elif 'payload' in suffix: suffix = suffix.split('payload=') payload = suffix[1].strip() suffix = suffix[0].strip() else: payload = None eg.TriggerEvent(prefix=prefix, suffix=suffix, payload=payload)
so what we have done is we created a universal MQTT payload parser. you ill need to change the message being sent. now you can create custom events using MQTT here is an example of a messageCode: Select all
MQTT.*
I was looking for events formatted like this :
Code: Select all
MyMQTT.MyComputer/run/kodi.startCode: Select all
payload = eg.event.payload
prefix = "My" + eg.event.string
if payload and isinstance(payload, (str, unicode)):
eg.TriggerEvent(prefix=prefix, suffix=payload, payload=None)If you listen the root of MQTT with a lot of mqtt messages the plugin seems to crash quickly :
Code: Select all
Exception in thread myMQTT:
Traceback (most recent call last):
File "threading.pyc", line 532, in __bootstrap_inner
File "C:\ProgramData\EventGhost\plugins\MQTT Client\__init__.py", line 521, in run
lrsp = mqttc.loop(10.0, 1)
File "C:\ProgramData\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 1004, in loop
rc = self.loop_read(max_packets)
File "C:\ProgramData\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 1282, in loop_read
rc = self._packet_read()
File "C:\ProgramData\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 1847, in _packet_read
rc = self._packet_handle()
File "C:\ProgramData\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 2294, in _packet_handle
return self._handle_publish()
File "C:\ProgramData\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 2465, in _handle_publish
self._handle_on_message(message)
File "C:\ProgramData\EventGhost\plugins\MQTT Client\paho\mqtt\client.py", line 2612, in _handle_on_message
self.on_message(self, self._userdata, message)
File "C:\ProgramData\EventGhost\plugins\MQTT Client\__init__.py", line 389, in on_message
ProcessEvent(msg, True, 1.0, res_key, event)
File "C:\ProgramData\EventGhost\plugins\MQTT Client\__init__.py", line 272, in ProcessEvent
TriggerEvent(msg)
File "C:\ProgramData\EventGhost\plugins\MQTT Client\__init__.py", line 252, in TriggerEvent
smsg = msg.topic.decode('utf-8')
File "encodings\utf_8.pyc", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc0 in position 12: unexpected end of dataNow I'm happy with it, I control my computer from Home Assistant, thanks to the creator and the community
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: MQTT Client
@Schmurtz
I had updated this plugin a while back to fix that decoding issue. you can download it HERE
I had updated this plugin a while back to fix that decoding issue. you can download it HERE
Re: MQTT Client
I have tried to install the MQTT plugin in eventghost but when trying to add the plugin eventghost stalls completely. I have tried both on a win 8.1 and a win 7 machine with same result.
Anyone got an idea what can be done?
Anyone got an idea what can be done?
Re: MQTT Client
Which version of EG and the plugin? How do you install (double click .egplugin file, copy to directory)?
You could also run EG from command line with the -debug parameter and see it prints any error message.
You could also run EG from command line with the -debug parameter and see it prints any error message.
Re: MQTT Client
EG version 0.4.1.r1722 and client version 1.1.0.
I just doubleclick the file with EG open. It shows the client fine between the plugins.
I just doubleclick the file with EG open. It shows the client fine between the plugins.
Re: MQTT Client
solved
I just used plugin version 1.2.2 instead!
Re: MQTT Client
Thanks for that !kgschlosser wrote: Thu Jan 31, 2019 6:58 pm @Schmurtz
I had updated this plugin a while back to fix that decoding issue. you can download it HERE
Seems really more stable now.
I don't know who manage this download page but it should be uploaded here too :
http://www.eventghost.rocks/forum/db/pl ... tt_client/
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: MQTT Client
the original author no longer uses EventGhost and I do not believe he is maintaining this plugin any longer. I do not ue MQTT and do not have enough knowledge about it to be able to maintain it properly. I can make small fixes and post those. but that is not enough to open up a new forum thread for it.
Re: MQTT Client
The file is not available anymore. I think that it is really a shame for the community to not have this stable versionkgschlosser wrote: Thu Jan 31, 2019 6:58 pm @Schmurtz
I had updated this plugin a while back to fix that decoding issue. you can download it HERE
