bobzomer / domoticz_pyaircontrol

Domoticz plugin to interact with Philips air purifier
MIT License
0 stars 1 forks source link

'onCommand' failed 'HTTP Error':'HTTP Error 422: ' #2

Open wlodass opened 2 years ago

wlodass commented 2 years ago

Hi again,

I returned to try connect purifier with domoticz. Now I have domoticz installed as system service. I'm using Zigbee via MQTT and this work fine - comunication with sensors is stable, but cannot connect purifier.

system is up to date domoticz beta is up to date Python3 installed pyaircontrol installed your plugin exists in domoticz hardware I can control purifier via ssh terminal My Philips purifier have IP 192.168.1.70, and I choose HTTP protocol.

error

I have no idea what I should to do more... can you help me?

bobzomer commented 2 years ago

Hello,

Can you tell me how you control your purifier through SSH? The exact command? So that I can compare with what the plugin does.

On Wed, 12 Jan 2022 at 21:04, wlodass @.***> wrote:

Hi again,

I returned to try connect purifier with domoticz. Now I have domoticz installed as system service. I'm using Zigbee via MQTT and this work fine - comunication with sensors is stable, but cannot connect purifier.

system is up to date domoticz beta is up to date Python3 installed pyaircontrol installed your plugin exists in domoticz hardware I can control purifier via ssh terminal My Philips purifier have IP 192.168.1.70, and I choose HTTP protocol.

[image: error] https://user-images.githubusercontent.com/75898891/149212434-d216fbcb-1f96-4405-b9e8-0ae6f266ceb4.JPG

I have no idea what I should to do more... can you help me?

— Reply to this email directly, view it on GitHub https://github.com/bobzomer/domoticz_pyaircontrol/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIAQGGCOQ2EEOFFPF5J5KYTUVXND3ANCNFSM5LZ34WNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

wlodass commented 2 years ago

I can control it by ssh terminal on rasbperry debian buster system and airctrl command

sanderdewit commented 1 year ago

I've looked into the HTTP request a bit more. When I zoom into this function.

  def onPollDevice(self):
        if self.client is None:
            return
        status = self.client.get_status()
        Domoticz.Log(status)
        for index, (_, name, type_, subtype, options) in enumerate(self.devices):
            if type_ == 0:  # Not yet enabled
                continue
            try:
                value = status[name]
                if type_ == 244:
                    Devices[index + 1].Update(nValue=value, sValue={'1': 'on', '0': 'off'}.get(value, 'off'))
                else:
                    Devices[index + 1].Update(nValue=1, sValue=str(value))
            except KeyError:
                pass

I've printed the status request and get back the following message. I think the message parsing goes wrong and it goes into the exception instead of processing it.

content of status: OrderedDict([('om', '0'), ('pwr', '0'), ('cl', False), ('aqil', 0), ('uil', '0'), ('dt', 0), ('dtrs', 0), ('mode', 'S'), ('func', 'PH'), ('rhset', 50), ('rh', 53), ('temp', 15), ('pm25', 16), ('iaql', 4), ('aqit', 4), ('ddp', '0'), ('err', 0), ('wl', 100)])