Fixed the Dockerfile and added basic authentication using nginx and docker-compose

Hi @Tpt, thanks a lot for this nice implementation of SPARQL in Rust!
I met some issues when trying to run the latest source using Docker, I fixed them and added a few improvements to the docker deployment

[x] I fixed the Dockerfile that was in the server folder, some dependencies were missing, and it needs to be in the root folder to be able to install the oxigraph crate from the local directory

[x] Added a docker-compose.yml and server/nginx.conf to deploy with nginx authentication on /update, it has been mentioned in this issue: https://github.com/oxigraph/oxigraph/issues/88

It would be better if authentication was implemented directly in Rust, but in the meantime using a nginx proxy to add authentication only on /update can be convenient if someone wants to deploy the SPARQL endpoint publicly

[x] Added a GitHub Action workflow that will build and publish the docker image to the GitHub Container registry at ghcr.io/oxigraph/oxigraph

DockerHub now has pull rates limits that can be a pain when working in cluster, and it's convenient to have everything in the same codebase. The workflow will publish every push to the master branch as the latest tag, and every new release as the corresponding tag (v0.1.2 will be published as tag 0.1.2)

[x] Updated the server/README.md to reflect the mentioned changes

Also, most commands where instructing to use oxigraph_server load --file my_file.nq --location my_data_storage_directory but the right command is actually oxigraph_server --location my_data_storage_directory load --file my_file.nq so I changed it

[x] Added the volumes shared by docker in the .gitignore

Let me know if there are any changes you would like to do!

For the Dockerfile location I'll move it, I had some weird behavior with calling the parent folder even when in the context path just in GitHub Actions in the past, but I think it was not with buildx :)

Thank you! I am not sure providing them "built-in" and ready to use is the best thing to do. Oxigraph reusers are likely to want to customize them (e.g. change which path are allowed, which are not, add more containers to the Docker Compose file...). I would feel more confortable providing them as "examples" in the server README and have the compose file pulling a released version of the container to avoid people naively rebuilding the container on docker-compose up.

My approach focuses on not needing to rebuild the existing nginx container, and just configure it at runtime directly with the server/nginx.conf, so there is no need to build, host and maintain an extra image (environmentally friendly!)
It is also easier for the users to custom, as can they can edit the nginx.conf or docker-compose.yml before starting the docker-compose without needing to rebuild the nginx proxy image. And they don't need to fiddle with the different files paths (calling nginx.conf from the docker-compose.yml)
But I probably see things this way because I usually clone the repository
If you plan on users not needing to clone the repo then putting the docker-compose.yml file in the README makes sense, but we will need to publish also this image: add a Dockerfile and a specific workflow to only republish this image when the nginx.conf or Dockerfile change. Or just ask the users to copy the nginx.conf themselves alongside the docker-compose.yml, we have seen more dangerous operations but you never know with the users nowadays

For the Dockerfile location I'll move it, I had some weird behavior with calling the parent folder even when in the context path just in GitHub Actions in the past, but I think it was not with buildx :)

Thank you!

My approach focuses on not needing to rebuild the existing nginx container, and just configure it at runtime directly with the server/nginx.conf, so there is no need to build, host and maintain an extra image (environmentally friendly!)

That's great! Thank you! About have the compose file pulling a released version of the container to avoid people naively rebuilding the container on docker-compose up. I was talking about the Oxigraph container that is now rebuilt by compose, not nginx. Sorry.

If you plan on users not needing to clone the repo then putting the docker-compose.yml file in the README makes sense, but we will need to publish also this image: add a Dockerfile and a specific workflow to only republish this image when the nginx.conf or Dockerfile change. Or just ask the users to copy the nginx.conf themselves alongside the docker-compose.yml, we have seen more dangerous operations but you never know with the users nowadays (also it makes it easier to custom, but you'll have a really long README)
Let me know what would be your favorite approach for the docker-compose: publishing a new image or the user copy/paste everything from the readme?

I am more in favor of asking the users to copy/paste everything from the readme, including the nginx.conf. They should take time to customize the user and password anyway and think which piece of the server they want to expose externaly or not. They are also likely to want to enable https. So, making this process manual is fine imho.

I'll make the changes when I find some times.

Amazing! Thank you!

Thank you!


Minor QTFF binary template fixes - atom size, date formatting

Use macdate for QTFF creation/modification times
Swap cases for atom size 0 and 1
I can't find any isom files with 4GB+ atoms to check, but according to specs and original Apple QTFF spec, size 0 and 1 should be other way around.

Ah nice! I actual ran into this issue at work last week and was about to send a PR with the same fix :) In that case the file was not over 4GB but still used 64 bit size extension.

Wonder how i mixed them up, maybe i only tested rest-of-file case and that probably will seem to work for 64 bit extension files also but it wont decode some parts

Ah, I didn't think of that, just replacing a wide on one of my files and 0 padding the size after box type to test, I was kind of unsure if it it was a change along the history of QTFF -> ISO BMFF -> MP4, or if it was just a typo. I can see myself mixing the two up, only human :P But I guess mov files don't use the "size 0 to extend to eof" case too often, I couldn't find a single one, maybe it makes sense not to have extra code in editing programs for the last atom in the file though.


Viber app

Please add themed icon for Viber
https://play.google.com/store/apps/details?id=com.viber.voip
package name: com.viber.voip

Yep, same.


Create docker.md in portuguese

Description of what is docker in portuguese to complement the documentation.

/assign @femrtnz

/assign @femrtnz

/assign @femrtnz

/lgtm
/approve
Thanks


emoji support

How to send push with emojis?

@superainovacoes you need to send the unicode value. You can look them up at:
http://apps.timwhitlock.info/emoji/tables/unicode

i have just checked and it did not work.
i am using node-gcm module, the string is "teste U+1F601 será? U+1F602 aahaha"
when i receive the push the string above is identical.

@superainovacoes oh sorry, use this table instead:
http://www.easyapns.com/category/just-for-fun

@macdonst no success :cry: i already have tried all the emoji types/formats
do you use emoji on notifications? are you using node-gcm?

@macdonst does your test works?

@superainovacoes take the unicode value like U+1F601 and translate it to a HTML entity code like: 😂. This is working for me.

Thanks it works.


Integration test framework improvement

We still need to do some more improvement on integration framework (tests/integration) to make it more useful and easy to adopt.
--- 18.03.16

[ ] Eliminate the use of the entry script, i.e. move component related parts into specific components
[ ] Upload logs as artifacts when running in CI
[ ] Add entry to download mac envoy binary for local development
[ ] Fix dummy wait in component readiness
[ ] Migrate some mixer tests into this framework https://github.com/istio/istio/tree/master/mixer/test/client

fyi @hklai and let me know if you have more in your mind.

Obsolete in favor of the SWAT team work.


My git config --global --list only returns the user.email and user.name

Is this a problem? Why they are different from 'git config --list' which returns all information
@hectorsector

@RaymondSHANG Eric has some specific configs that he's already set from prior uses. For now, we're just interested in user.name and user.email.

Here's some documentation if you're interested in all the possibilities.

Got it, thanks.

Eric's terminal settings of display seems cool. Could he share the PS1 please?:-)
@hectorsector

sure, I think he's using zsh, but we'll ping him so he can drop it after class
@hollenberry 👀 🙏

https://github.com/sorin-ionescu/prezto


chore: Use node 14 for Apple test loops

Summary
Our "Verify react-native-macos-init" loop is failing in 0.66-stable because the latest version of react-native, 0.68, requires a minimum Node version of 14.
The main branch currently uses Node v16, but I figure that only upgrading to 14 is a more minimal change that should get everything working.
Test Plan
If the CI passes, we know it works :-)

I would actually just go straight to 16, since we've made that standard elsewhere

I would actually just go straight to 16, since we've made that standard elsewhere

I only went to 14 since this is the minimal change that will unblock #1116, which is a critical fix. The CIs have passed, so I'm gonna check this in now, but jumping to 16 isn't a bad idea, so I'll send a PR out for that at a later time.


Not detecting HealthProtect 7770i (new AWS API issue)

The plugin is not detecting our connected BlueAir device; I can see from the logs I am getting a token but 0 devices are detected. The device is controllable from the BlueAir app.

Same issue with HealthProtect 7470i.
[16/11/2021, 16:35:13] [BlueAir] Got homehost: api-us-east-1.blueair.io
[16/11/2021, 16:35:13] [BlueAir] x-auth-token: actual-token-removed
[16/11/2021, 16:35:14] [BlueAir] Found 0 devices.

I'm experiencing the same problem with two BlueAir HealthProtect 7410i purifiers. (The plugin finds 0 devices.)

Thanks guys. I don't have those units so perhaps the JSON is different. I'll enable some additional debugging in the next version.

Actually if you just enable debugging in the Homebridge UI, you should see a debug of the response just prior to the part when it tells you that you have 0 devices. It would be great to see that response.

@fjs21 I enabled homebridge debug mode and this is what I got upon restarting:
[21/11/2021, 19:11:16] [BlueAir] Initializing BlueAir platform...
[21/11/2021, 19:11:16] [BlueAir] base_API_url<EMAIL_ADDRESS>[21/11/2021, 19:11:16] [BlueAir] Finished initializing platform: undefined
[21/11/2021, 19:11:16] Loading 2 accessories...

I don't, however, see the purifiers in the Home app or in the Homebridge config UI accessories tab.

That last line isn't tagged with [BlueAir] so I'm not sure what that means.
Also it seems you are not seeing the line 'Found %s devices.' Or the json debug information. Very strange. Not sure what's going on.

@fjs21 I missed some of the other lines – sorry about that. Here are all the [BlueAir] messages that appeared on a server restart:
[21/11/2021, 19:48:51] [BlueAir] Initializing BlueAir platform...
[21/11/2021, 19:48:51] [BlueAir] base_API_url<EMAIL_ADDRESS>[21/11/2021, 19:48:51] [BlueAir] Finished initializing platform: undefined
[21/11/2021, 19:48:51] [BlueAir] Executed didFinishLaunching callback
[21/11/2021, 19:48:52] [BlueAir] Got homehost: api-us-east-1.blueair.io
[21/11/2021, 19:48:53] [BlueAir] x-auth-token: rEdAcTeDaUtHtOkEn
[21/11/2021, 19:48:53] [BlueAir] []
[21/11/2021, 19:48:53] [BlueAir] Found 0 devices.

I hope that's useful. Thanks so much for your help.

Ugh. Looks like the server just gave a blank response.
It could mean that the API is different for your purifier. My guess is we need to get postman to see if we can work out what is needed.

Gosh darn API. I can help if you need more information about this model.

Do we you use the BlueAir app to control?

I do here.

Do you use the BlueAir app to control?

Yes, I do

Do you use the BlueAir app to control?

Hi Fraser, I do use the BlueAir app. I got postman installed and captured some of the API data. How best to share it with you?

Well. We are looking for requests to the BlueAir API. The request the provides a JSON of the devices on the account. For my Classic, the address defined as follows:

const url: string = 'https://' + this.homehost + '/v2/owner/' + this.username + '/device/';

so something like "https://api-us-east-1.blueair.io/v2/owner/username/device"
For your devices, this returns a blank response. So maybe a variation on this is sent when the BlueAir app first contacts the server on startup. Maybe postman can capture this and we can give it a try to see if we can get the device data returned.

Here is the postman JSON. I removed email and tokens. Let me know if you need something else and I'll try to gather it.
BlueAir Collection.postman_collection.json.TXT
.

I have a Blueair DustMagnet 5440i, and it exhibits this same issue with this Homebridge plugin.
I'm happy to help debug and/or provide remote access if you think it'd help develop this plugin further.

Yeah. This could help a lot. I'm just starting to look this over now. The API looks completely different based on @fluffyx CURL.

Here is the postman JSON. I removed email and tokens. Let me know if you need something else and I'll try to gather it.
BlueAir Collection.postman_collection.json.TXT .

Thanks. It looks like the URL for your device is much more similar to mine. The same homehost url - api-us-east-1.blueair.io - and general structure.
I am ignoring the "outdoor" ones which I think is for the stuff in the app based on the ZIP code.
I see the device request. Which is name<EMAIL_ADDRESS>But the response is blank...?
I have no idea what the "stomp", "token/exchange", "get" requests do.
Were the responses removed? Even the homehost request returned a blank response and yet that did work above.
@tkundhi did you see any reference to the URLs mentioned above by @fluffyx ?

I suspect these are all part of the Accenture IoT deal this a totally different API and likely different backing infrastructure etc. : https://newsroom.accenture.com/news/accenture-helps-blueair-raise-manufacturing-productivity-and-add-new-services-to-its-connected-air-purifiers.htm

I suspect these are all part of the Accenture IoT deal thus a totally different API and likely different backing infrastructure etc. : https://newsroom.accenture.com/news/accenture-helps-blueair-raise-manufacturing-productivity-and-add-new-services-to-its-connected-air-purifiers.htm

Wow! Good find. This looks highly likely for the newer devices.

@fluffyx - could you post how you got that information? perhaps the other users of the HealthProtect can post their info? My guess is the "52e8534b-d958-4c20-8c2c-b631e94ab0af" is a device ID. You sensibly redacted the authorization part of the header.
Looks like "/r/initial" or "/a/fanspeed" are the commands - maybe something like "read initial", "action fanspeed"
We would like need to find out the following steps:

How the root URL is determined? Is there an initial login step where this is responded or is this hard-coded for all users?
How is the user authenticated so that a token is provided for future requests?
How are the devices (aka device IDs/uuids) on each account enumerated?
How is device status/sensors polled?
How are actions sent to the device?

I'll start a user editable wiki so folks can start putting together this information. As I don't have this device, I won't be able to do much directly but I am happy to help and hopefully incorporate with the existing devices.

To get the info I posted above, I used Proxyman on macOS with my iPhone proxied to Proxyman.

I think this might be part of the answer?
GET<EMAIL_ADDRESS>HTTP/1.1 Host: api.blueair.io Accept-Encoding: gzip, deflate, br Accept: application/json;charset=UTF-8 X-API-KEY-TOKEN: [redacted] User-Agent: Blueair/58 CFNetwork/1327.0.4 Darwin/21.2.0 Accept-Language: en-US,en;q=0.9 Connection: keep-alive
The Homebridge plugin authenticates successfully for me but lists 0 purifiers. Not sure if that's a full answer.
Devices are enumerated as follows:
curl 'https://on1keymlmh.execute-api.us-east-2.amazonaws.com/prod/c/registered-devices' \ -H 'Host: on1keymlmh.execute-api.us-east-2.amazonaws.com' \ -H 'Connection: keep-alive' \ -H 'idtoken: [redacted]' \ -H 'Accept: */*' \ -H 'User-Agent: Blueair/58 CFNetwork/1327.0.4 Darwin/21.2.0' \ -H 'Authorization: Bearer [redacted]' \ -H 'Accept-Language: en-US,en;q=0.9' \ --proxy http://localhost:9090

{"devices":[{"name":"52e8534b-d958-4c20-8c2c-b631e94ab0af","wifi-firmware":"2.2.9","mcu-firmware":"2.2.8","type":"G4","uuid":"17f8c313-d413-4b7f-aff5-42b753dccc5c","mac":"84:cc:a8:0d:32:cc"}]} (I only have one Wi-Fi Blueair device)

There's a separate URL for outdoor air quality, which I don't care about for my use case, but it seems these two calls are done to yield CURRENT air quality data and then HISTORICAL air quality data (for display in a graph). My air cleaner only detects PM2.5; the HealthProtect gives the same PM2.5 in addition to 3 other measurements.  I can tell you that the tokens eventually expire. If I replay a fan control command, it works now, but if I try the same token again tomorrow, it has expired.
If you think you want to do something useful with it, @fjs21, I'd be happy to provide remote access to my DustMagnet 5440i.

@fluffyx, I was able to use my credentials to login (step 2) above using the plugin code. However, I need to find in the response from this - the parts I need to pass onto the next step.
Looking over the response, I don't see "idtoken" or "Authorization" but perhaps by searching in your response you can find them?

I made a pre-release v0.8.0 which should allow folks to login to the AWS-based API. Hopefully, the next step will be working out which values in that response are needed.

Hi Fraser, I’m away until early January. I don’t recall see the URL posted by @fluffyx.
I did get the “outdoor” responses too. I simply ignored them when creating the file.
Tarun Kundhi
Sent while mobile
On Dec 29, 2021, at 3:12 PM, Fraser Sim @.***> wrote:

Here is the postman JSON. I removed email and tokens. Let me know if you need something else and I'll try to gather it.
BlueAir Collection.postman_collection.json.TXT .
Thanks. It looks like the URL for your device is much more similar to mine. The same homehost url - api-us-east-1.blueair.io - and general structure.
I am ignoring the "outdoor" ones which I think is for the stuff in the app based on the ZIP code.
I see the device request. Which is name: @.***/device/"
But the response is blank...?
I have no idea what the "stomp", "token/exchange", "get" requests do.
Were the responses removed? Even the homehost request returned a blank response and yet that did work above.
@tkundhi did you see any reference to the URLs mentioned above by @fluffyx ?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.

Hi,
Aby update here? Can I help somehow?

Hi, I have the Blueair DustMagnet 5440i just like @fluffyx. I'm crossing my fingers support gets added for this model! I'm not much of a coder so I probably can't contribute anything meaningful, but I'm here to support however I can!

Let me see how things were left in the current version. If you guys are interested in helping, I would need you to post/send me some details of the response you get when the AWS login is completed (immediately after homebridge starts and the plugins initialize). I'll post instructions once I have reviewed the current code and made necessary changes.

Let me see how things were left in the current version. If you guys are interested in helping, I would need you to post/send me some details of the response you get when the AWS login is completed (immediately after homebridge starts and the plugins initialize). I'll post instructions once I have reviewed the current code and made necessary changes.

I'll need to make some changes so look out for a new version. You will also need to enable debugging in Homebridge to attempt to connect to the AWS API. I should have sometime tonight to implement the changes and publish a new version.

Let me see how things were left in the current version. If you guys are interested in helping, I would need you to post/send me some details of the response you get when the AWS login is completed (immediately after homebridge starts and the plugins initialize). I'll post instructions once I have reviewed the current code and made necessary changes.

I'll need to make some changes so look out for a new version. You will also need to enable debugging in Homebridge to attempt to connect to the AWS API. I should have sometime tonight to implement the changes and publish a new version.

So version 0.9.2+ contains a new setting in the config panel to "enableAWS". This will currently just send a request to the AWS server. You will see a response in your log at startup.
What I need is for someone with these devices to run a postman to capture which of these variables is being sent during login to get a list of the devices that is associated with the account.
Basically how to go from step 2. to step 3. of the comment above by @fluffyx.
I am able to login and get the long response (and you should be too). We need to see what variables are then sent in the header as "idtoken" and "Authorization" to return a list of devices.

GET /prod/c/registered-devices HTTP/1.1
Host: on1keymlmh.execute-api.us-east-2.amazonaws.com
Connection: keep-alive
idtoken: eyJraWQiOiJNM2FTZDlOVDdiTjEwbUh3NEdWcEpNbmFtcnZJTzdzcDhLUTg0SHBzS2E0PSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiIwY2FiM2ZiYS0xYjgxLTRjMGUtOWNkMi1lYjg5NDI0YmZjODAiLCJldmVudF9pZCI6IjAzNWExNTI2LTQyYjgtNGEwNy1hYzhlLWM3NmQwMjhkNjNhYSIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXdzLmNvZ25pdG8uc2lnbmluLnVzZXIuYWRtaW4iLCJhdXRoX3RpbWUiOjE2NDY3NjQ1MTcsImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWl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cy1lYXN0LTIuYW1hem9uYXdzLmNvbVwvdXMtZWFzdC0yX2lwR2VkaGxPUiIsImV4cCI6MTY0Njg1MDkxNywiaWF0IjoxNjQ2NzY0NTE3LCJqdGkiOiIzYjhiMTFkNi1jMDNmLTRlNzctYjc4NS02MDc5ODA1MThiMDYiLCJjbGllbnRfaWQiOiI3cDFxb2t0ZjJqbWxzdXVkOG0yaHZqNGtjZyIsInVzZXJuYW1lIjoiNTI1NmEzOTMtOTk5OC00NjdjLTk1MWEtMjE1NjQzZTBhNWEzIn0.QV9QwUfB5fVaFxNp0pBC3a3FiCZaMp3-17_wK-AhZbRHwV7C34fPlKf9AAtDr6uw6z3EqAtjTkvG2gzUV0ygyEvJLye7DOrwyhLitL9O91UNfjUcI1YA1vHkw-qFcOoIkKHueFkiaujiKmDiIsdacecr_JpfQn2PKQbbFnGlgLCWVnuLbzNt6doaACx7o5LvP2TI-9S9ejy4SmVQBUq3k9Hef6pQee-JWDjh7lhv9ENGo3vR69lJnOLlzRf7PxxXHfrMBqGAdF5wkmLDooZNzRHUL_yyz2glvIrHH-XR1mWNvnCR5piXKXsVyFvHagl32NhQ-CReCyNsAjWeEfbDwg
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate, br

Thanks! So the response on login does not provide the idtoken that we will need to make a request to get the list of devices. I looked on the AWS API website - which is what it looks like this is using. Here's a link: https://docs.aws.amazon.com/en_us/search/doc-search.html?searchPath=documentation-guide&searchQuery=idtoken&this_doc_product=Amazon API Gateway&this_doc_guide=Developer Guide#facet_doc_product=Amazon API Gateway&facet_doc_guide=Developer Guide
It looks like there is a missing step where the info from the login is sent to AWS and the idtoken is returned which is then used in the registered device request. Are there any other request/responses that occur between the two steps. Looking specifically for this createToken or similar.

I think this of one of the first requests made. Is there anything of use in here?

POST /prod/c/login?client_id=2m1pfaga6vdd557fnl7lbn1ljq&client_secret=1r152pm64c1ojfdi9acnqpjlop0kl8kocl3kij3qj988p6cem4t8&scope=todo HTTP/1.1
Host: on1keymlmh.execute-api.us-east-2.amazonaws.com
User-Agent: Blueair/75 CFNetwork/1331.0.3 Darwin/21.4.0
Connection: keep-alive
idtoken: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlJFUTBNVVE1TjBOQ1JUSkVNemszTTBVMVJrTkRRMFUwUTBNMVJFRkJSamhETWpkRU5VRkJRZyJ9.eyJpc3MiOiJodHRwczovL2ZpZG0uZ2lneWEuY29tL2p3dC8zXy14VWJicklZOFFDYkhEV1FzMXRMWEUtQ1pCUTUwU0dFbGNPWTVoRjFldUUxMXdDb0lsTmJqTUdBRlE2VXdoTVkvIiwiYXBpS2V5IjoiM18teFViYnJJWThRQ2JIRFdRczF0TFhFLUNaQlE1MFNHRWxjT1k1aEYxZXVFMTF3Q29JbE5iak1HQUZRNlV3aE1ZIiwiaWF0IjoxNjQ2NzY0MDIyLCJleHAiOjE2NDkzOTM3NjgsInN1YiI6IjYwMWM0MWI3ZTIxNTQzNmY4YmRhNTBjNDZjNDNhNGUzIiwiZW1haWwiOiJraXJrZGFobDExQGdtYWlsLmNvbSJ9.LxI08EKrEsYYhiMbDcYNXo6c1_mcOZpZWZ8GCZ92d8TLDtuPINFyIO0VmoHxZiwAVYj9mTRkf9qYAUJ60IN9ujB-sSprjRi5xqufeia91aEU9o_KwpHFR8dHoli_DsV0B6BAJqi7hA5VDo-ebQ8pPc1VU4171SGYcevxbLpeRl-OhWioWyExIdoJ2MZo746JhhYsy0ZwNi75C1o9DO2BA7tQpN96nUBTvowMFUfRbL5PCzYUd1reRgvNV0LQeCRPsYg0U-r3zOrFBeTTyJX6jDAdXxeuMG4tKKPhEvNXTxJnFb8qa32xAcmHOsagqPg8vuwr7GawxU-RaqDaVtufQw
Accept: */*
Accept-Language: en-US,en;q=0.9
Content-Length: 0
Accept-Encoding: gzip, deflate, br
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlJFUTBNVVE1TjBOQ1JU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yX2lwR2VkaGxPUiIsImV4cCI6MTY0Njg1MDQyMywiaWF0IjoxNjQ2NzY0MDIzLCJqdGkiOiJiYTY3OTBiNC00ODFhLTQzMDgtOWNkNi1hMDRiZTM2OWJhZDkiLCJjbGllbnRfaWQiOiI3cDFxb2t0ZjJqbWxzdXVkOG0yaHZqNGtjZyIsInVzZXJuYW1lIjoiNTI1NmEzOTMtOTk5OC00NjdjLTk1MWEtMjE1NjQzZTBhNWEzIn0.VOqG1u3s2vrA1psgiKCIa7a35Y1vyYffdhpBJT9SLc6wfEaWHrz_VouMBk9zedHbYgIQlFdJx_ZURrctIOjVlsyeSrm1XzRQltSMbqQNHW9TYZS1YlUCL57y5NZNy6brdmVVzBDP6KxY3cA_ttfOaN9yAqkhKimwdMNviWHZeJyxNGz2mDW1o941as0RiBbUtkSx0KutTO76JsHv4U_Qb7StfNcFVYpDHQbIj-nsdQfci-A3ItTVV_sm1C5Sl_N8Yjg_ofXnxfS9CDYchtwalMSXE0EM7uLJ4T5eoppzQFBEReKh0vFDuxRFUqvVwUHXpU1Mm9BSgSDnzQGY7qAbcQ",
  "token_type": "Bearer",
  "expires_in": "86400"
}

I recently got a DustMagnet 5240i and could try to provide any info you need to help move forward with support for these

Hi @fjs21 - please see the pull request above. There is definitely still work to be done, but I wanted to send that over to see if it sparks some additional thoughts/collaboration. I'll see if I can spend some time over the next week to dig into it a bit more in terms of actually detecting the devices and starting to control them.

Thanks! I hope that once we have the login sorted out it should be straightforward to have commands dealt with in a similar manner. We can make a new set of accessories that talk to the AWS portion of the API code using similar approaches to the original.

Hi all - I think I've mapped all of the various transactions as a Postman Collection. All you should have to do is import it into Postman, and then fill in your username and password variables locally and run the API requests in order.
https://www.getpostman.com/collections/9f7153170757ec6e2f19

@tkundhi Can you try importing the Postman collection I linked to above and see if it works for your HealthProtect?
@KirkDahl @PeytonRG It looks like you both have other versions of DustProtect - I assume the API endpoints work the same as mine (5210i) does, but if you are familiar with using the Postman application, let me know if it does indeed work or not.

@jonato1 My 5240i is basically an identical product to the 5210i but with fabric on the sides. I imported your collection, ran through all the commands and they worked flawlessly! Awesome work!

@jonato1,  imported and successfully ran the collection. It reports back a device. I've saved the Get Devices and Get State responses. Let me know if you need them. All the Service requests came back as "Success"
Thanks for making it easy to test locally. I don't use Postman regularly and didn't keep notes on how I set it up to do my previous tests, so I haven't had time to go back and reconfigure things to have homebridge proxy through Postman. Let me know if you need me to do anything else.

@PeytonRG That is great to hear - thanks for confirming.
@tkundhi Likewise, this is great to hear! If you can send over the response from "Get Devices" and "Get State", I think that could be helpful to review.
@fjs21 - I found myself pretty excited to get back into the habit of coding this week, so see the PR above. Definitely still in a rough draft, but I would consider this an alpha release.  I just added support for the HealthProtect (updated the case statement) in my latest commit, which is included in the PR above.
https://github.com/fjs21/homebridge-blueair/pull/13/commits/b024d88e53025ae7e702d669731d2c7f78d920d0
A few outstanding questions if you can provide insight, and also play around with running the "Get State" while the HealthProtect is turned on, and has been running for 5-10 minutes.

Do you know what GermShield does? Do you see value in being able to control it via Homebridge/HomeKit?
Do you know what Safety Switch does? Do you see value in being able to control it via Homebridge/HomeKit?
While the unit is on and has been running, what sensor data do you see? PM 1.0, PM 2.5, PM 10, VOC, etc.?

Thanks again!

@jonato1 Germshield essentially puts the fan on super low and (to the best I can figure) a plasma charger (likely an ionizer like here) to in theory break up virus/bacteria cell walls. I personally would find it useful to have a toggle available.

@Bubbgump209 Sounds good - I'm coding in the dark, but I think I got initial support added for it here: https://github.com/fjs21/homebridge-blueair/pull/13/commits/a270f4461a749dc742c3abf251b159a1302e9f89. That said, I can't test, so I wouldn't be surprised if there might be an error thrown somewhere. Once this makes it into a version that you can test, feel free to communicate any issues.

Hi all, I just published v1.0.1 which includes @jonato1's contributions. Please post your results here.

Sadly it's crashing Homebridge:
TypeError: Cannot read properties of undefined (reading 'sessionToken')
at BlueAirApi.awsLogin (C:\Users\Administrator.THEFIRESWAMP\AppData\Roaming\npm\node_modules@fjs21\homebridge-blueair\src\blueair-api.ts:489:44)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at BlueAirHomebridgePlatform.discoverDevices (C:\Users\Administrator.THEFIRESWAMP\AppData\Roaming\npm\node_modules@fjs21\homebridge-blueair\src\platform.ts:95:7)

Thanks for all the work to all. I have a DustMagnet 5410i login looks like it's working, but not seeing the accessory yet. These are the logs from startup:
     'wifi-firmware': '2.2.23',       mac: 'c4:dd:57:7f:36:94',       name: '52457c8f-bcf2-4ae4-b7e0-5333b0c8aba7',       type: 'B4',       uuid: '17827a8e-0971-468b-9623-aa495a0573e4'     }   ] } [4/14/2022, 12:51:45 PM] [@fjs21/homebridge-blueair] Found 1 devices. [4/14/2022, 12:51:45 PM] [@fjs21/homebridge-blueair] ** AWS devices - end ** [4/14/2022, 12:51:46 PM] [@fjs21/homebridge-blueair] ** AWS login begin ** [4/14/2022, 12:51:46 PM] [@fjs21/homebridge-blueair] ** AWS login end ** [4/14/2022, 12:51:47 PM] [@fjs21/homebridge-blueair] ** AWS devices - begin ** [4/14/2022, 12:51:47 PM] [@fjs21/homebridge-blueair] {   devices: [     {       'mcu-firmware': '2.3.0',       'wifi-firmware': '2.2.23',       mac: 'c4:dd:57:7f:36:94',       name: '52457c8f-bcf2-4ae4-b7e0-5333b0c8aba7',       type: 'B4',       uuid: '17827a8e-0971-468b-9623-aa495a0573e4'     }   ] } [4/14/2022, 12:51:47 PM] [@fjs21/homebridge-blueair] Found 1 devices. [4/14/2022, 12:51:47 PM] [@fjs21/homebridge-blueair] ** AWS devices - end ** [4/14/2022, 12:51:47 PM] [@fjs21/homebridge-blueair] Restoring existing accessory from cache: Living Room Purifier [4/14/2022, 12:51:48 PM] [@fjs21/homebridge-blueair] Device Info from findAwsModelAndInitialize:  [   {     id: '17827a8e-0971-468b-9623-aa495a0573e4',     configuration: {       df: [Object],       di: [Object],       _ot: 'CmConfig',       _f: false,       _it: 'urn:blueair:openapi:version:healthprotect:0.0.5',       _eid: '9e88402a-a10a-4c67-bd53-f2a041247296',       _sc: 'Instance',       ds: [Object],       _r: 'us-east-2',       _s: [Object],       _t: 'Partial',       _v:<PHONE_NUMBER>,       _cas:<PHONE_NUMBER>,       _id: '17827a8e-0971-468b-9623-aa495a0573e4',       fc: [Object],       da: [Object],       dc: [Object]     },     alarms: [],     events: [],     sensordata: [ [Object], [Object] ],     states: [       [Object], [Object],       [Object], [Object],       [Object], [Object],       [Object], [Object],       [Object], [Object],       [Object]     ],     welcomehome: { setting: [] }   } ] [4/14/2022, 12:51:48 PM] [@fjs21/homebridge-blueair] 52457c8f-bcf2-4ae4-b7e0-5333b0c8aba7: device type not recognized, contact developer via GitHub.

@jonato1 minor note. Looks like it is trying to enumerate devices twice.
[

14/04/2022, 14:06:17] [BlueAir] ** AWS devices - begin **
[14/04/2022, 14:06:17] [BlueAir] { devices: [] }
[14/04/2022, 14:06:17] [BlueAir] Found 0 devices.
[14/04/2022, 14:06:17] [BlueAir] ** AWS devices - end **
[14/04/2022, 14:06:19] [BlueAir] ** AWS login begin **
[14/04/2022, 14:06:19] [BlueAir] ** AWS login end **
[14/04/2022, 14:06:20] [BlueAir] ** AWS devices - begin **
[14/04/2022, 14:06:20] [BlueAir] { devices: [] }
[14/04/2022, 14:06:20] [BlueAir] Found 0 devices.
[14/04/2022, 14:06:20] [BlueAir] ** AWS devices - end **

@fjs21  Thanks for the heads up and the fix. I'm curious on the break of the case statement on line 341 - did you see something that indicates the DustProtect isn't supported? The reason I ask is because that is the model I have and the only model I was able to validate against locally.

@shbisson @A-vesalius Would you both be able to try the following?

Update to the latest version.
Enable debug mode in Homebridge, restarting, and then pasting your logs again? (Click the three dots in the top right >  Homebridge Settings > Startup Options > Toggle on "Homebridge Debug Mode -D".

Thanks for the quick feedback!

@fjs21 Thanks for the heads up and the fix. I'm curious on the break of the case statement on line 341 - did you see something that indicates the DustProtect isn't supported? The reason I ask is because that is the model I have and the only model I was able to validate against locally.

My bad. I did not notice the lack of the break... I'll fix and commit now.

@fjs21 No worries - I just actually enabled some extra logging that I had commented out. I also fixed the case statement. Feel free to pull and update further as needed. Thanks!

@jonato1 Also failing with a TypeError on an undefined property with my DustMagnet 5240i, and causing HomeBridge to restart in a loop. Logs below
[14/04/2022, 18:01:01] [BlueAir] ** AWS login begin **
[14/04/2022, 18:01:01] [BlueAir] ** AWS login end **
[14/04/2022, 18:01:02] [BlueAir] ** AWS devices - begin **
[14/04/2022, 18:01:02] [BlueAir] {
  devices: [
    {
      'mcu-firmware': '2.2.9',
      'wifi-firmware': '2.2.13',
      mac: '7c:9e:bd:2e:04:00',
      name: '52b3d525-bfbb-4d0b-b6a3-2052927e06ab',
      type: 'B4',
      uuid: '1f097e0e-a999-4977-939b-53bc48dd9fcb'
    }
  ]
}
[14/04/2022, 18:01:02] [BlueAir] Found 1 devices.
[14/04/2022, 18:01:02] [BlueAir] ** AWS devices - end **
[14/04/2022, 18:01:03] [BlueAir] Adding new accessory: 52b3d525-bfbb-4d0b-b6a3-2052927e06ab
[14/04/2022, 18:01:04] [BlueAir] Device Info from findAwsModelAndInitialize:  [
  {
    id: '1f097e0e-a999-4977-939b-53bc48dd9fcb',
    configuration: {
      df: [Object],
      di: [Object],
      _ot: 'CmConfig',
      _f: false,
      _it: 'urn:blueair:openapi:version:healthprotect:0.0.5',
      _eid: '91d03865-11f3-11ec-8fb8-35def321e829',
      _sc: 'Instance',
      ds: [Object],
      _r: 'us-east-2',
      _s: [Object],
      _t: 'Diff',
      _v:<PHONE_NUMBER>,
      _cas:<PHONE_NUMBER>,
      _id: '1f097e0e-a999-4977-939b-53bc48dd9fcb',
      fc: [Object],
      da: [Object],
      dc: [Object]
    },
    alarms: [],
    events: [],
    sensordata: [ [Object], [Object] ],
    states: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object]
    ],
    welcomehome: { setting: [] }
  }
]
[14/04/2022, 18:01:04] [BlueAir] Creating new object: BlueAirDustProtectAccessory
[14/04/2022, 18:01:04] [BlueAir] Accessory Info:  PlatformAccessory {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  services: [
    AccessoryInformation {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      iid: null,
      name: null,
      characteristics: [Array],
      optionalCharacteristics: [Array],
      isHiddenService: false,
      isPrimaryService: false,
      linkedServices: [],
      displayName: '',
      UUID: '0000003E-0000-1000-8000-0026BB765291',
      subtype: undefined,
      [Symbol(kCapture)]: false
    }
  ],
  reachable: false,
  context: {
    deviceApiName: '52b3d525-bfbb-4d0b-b6a3-2052927e06ab',
    uuid: '1f097e0e-a999-4977-939b-53bc48dd9fcb',
    mac: '7c:9e:bd:2e:04:00'
  },
  _associatedHAPAccessory: Accessory {
    _events: [Object: null prototype] { identify: [Function (anonymous)] },
    _eventsCount: 1,
    _maxListeners: undefined,
    displayName: 'Office Purifier',
    UUID: '7ab5f7f1-77f1-4134-9952-be75eba0dd27',
    aid: null,
    _isBridge: false,
    bridged: false,
    bridgedAccessories: [],
    reachable: true,
    category: 1,
    services: [ [AccessoryInformation] ],
    shouldPurgeUnusedIDs: true,
    initialized: false,
    controllers: {},
    _setupID: null,
    controllerStorage: ControllerStorage {
      initialized: false,
      fileCreated: false,
      purgeUnidentifiedAccessoryData: true,
      trackedControllers: [],
      controllerData: {},
      accessoryUUID: '7ab5f7f1-77f1-4134-9952-be75eba0dd27'
    },
    lastAccessoriesRequest: 0,
    getPrimaryAccessory: [Function (anonymous)],
    configurationChangeDebounceTimeout: undefined,
    [Symbol(kCapture)]: false
  },
  displayName: 'Office Purifier',
  UUID: '7ab5f7f1-77f1-4134-9952-be75eba0dd27',
  category: 1,
  [Symbol(kCapture)]: false
}
[14/04/2022, 18:01:04] [BlueAir] Accessory Name:  52b3d525-bfbb-4d0b-b6a3-2052927e06ab
[14/04/2022, 18:01:04] [BlueAir] Accessory UUID:  1f097e0e-a999-4977-939b-53bc48dd9fcb
[14/04/2022, 18:01:04] [BlueAir] Accessor object PlatformAccessory {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  services: [
    AccessoryInformation {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      iid: null,
      name: null,
      characteristics: [Array],
      optionalCharacteristics: [Array],
      isHiddenService: false,
      isPrimaryService: false,
      linkedServices: [],
      displayName: '',
      UUID: '0000003E-0000-1000-8000-0026BB765291',
      subtype: undefined,
      [Symbol(kCapture)]: false
    }
  ],
  reachable: false,
  context: {
    deviceApiName: '52b3d525-bfbb-4d0b-b6a3-2052927e06ab',
    uuid: '1f097e0e-a999-4977-939b-53bc48dd9fcb',
    mac: '7c:9e:bd:2e:04:00'
  },
  _associatedHAPAccessory: Accessory {
    _events: [Object: null prototype] { identify: [Function (anonymous)] },
    _eventsCount: 1,
    _maxListeners: undefined,
    displayName: 'Office Purifier',
    UUID: '7ab5f7f1-77f1-4134-9952-be75eba0dd27',
    aid: null,
    _isBridge: false,
    bridged: false,
    bridgedAccessories: [],
    reachable: true,
    category: 1,
    services: [ [AccessoryInformation] ],
    shouldPurgeUnusedIDs: true,
    initialized: false,
    controllers: {},
    _setupID: null,
    controllerStorage: ControllerStorage {
      initialized: false,
      fileCreated: false,
      purgeUnidentifiedAccessoryData: true,
      trackedControllers: [],
      controllerData: {},
      accessoryUUID: '7ab5f7f1-77f1-4134-9952-be75eba0dd27'
    },
    lastAccessoriesRequest: 0,
    getPrimaryAccessory: [Function (anonymous)],
    configurationChangeDebounceTimeout: undefined,
    [Symbol(kCapture)]: false
  },
  displayName: 'Office Purifier',
  UUID: '7ab5f7f1-77f1-4134-9952-be75eba0dd27',
  category: 1,
  [Symbol(kCapture)]: false
}
[14/04/2022, 18:01:04] TypeError: Cannot read properties of undefined (reading 'di')
    at new BlueAirDustProtectAccessory (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory_DustProtect.ts:93:45)
    at BlueAirHomebridgePlatform.findAwsModelAndInitialize (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platform.ts:345:9)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at BlueAirHomebridgePlatform.discoverAwsDevices (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platform.ts:224:9)
    at BlueAirHomebridgePlatform.discoverDevices (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platform.ts:97:7)
[14/04/2022, 18:01:04] Got SIGTERM, shutting down Homebridge...
[14/04/2022, 18:01:05] [BlueAir] Accessory Sensor # 0
[14/04/2022, 18:01:05] [BlueAir] Accessory Sensor { v: '0', n: 'pm2_5', t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory Sensor # 1
[14/04/2022, 18:01:05] [BlueAir] Accessory Sensor { v: '11', n: 'fsp0', t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 0
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'cfv', v: 33554957, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 1
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'filterusage', v: 7, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 2
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'brightness', v: 100, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 3
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'standby', vb: false, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 4
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'fanspeed', v: 11, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 5
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'nightmode', vb: false, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 6
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'childlock', vb: false, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 7
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'mfv', v: 33554953, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 8
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'ofv', v: 33554957, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 9
[14/04/2022, 18:01:05] [BlueAir] Accessory State { n: 'automode', vb: true, t:<PHONE_NUMBER> }
[14/04/2022, 18:01:05] [BlueAir] Accessory State # 10
[14/04/2022, 18:01:05] [BlueAir] Accessory State { t:<PHONE_NUMBER>, vb: true, n: 'online' }
[14/04/2022, 18:01:05] [BlueAir] Accessory PlatformAccessory {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  services: [
    AccessoryInformation {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      iid: null,
      name: null,
      characteristics: [Array],
      optionalCharacteristics: [Array],
      isHiddenService: false,
      isPrimaryService: false,
      linkedServices: [],
      displayName: '',
      UUID: '0000003E-0000-1000-8000-0026BB765291',
      subtype: undefined,
      [Symbol(kCapture)]: false
    },
    AirPurifier {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      iid: null,
      name: null,
      characteristics: [Array],
      optionalCharacteristics: [Array],
      isHiddenService: false,
      isPrimaryService: false,
      linkedServices: [],
      displayName: '',
      UUID: '000000BB-0000-1000-8000-0026BB765291',
      subtype: undefined,
      [Symbol(kCapture)]: false
    },
    AirQualitySensor {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      iid: null,
      name: null,
      characteristics: [Array],
      optionalCharacteristics: [Array],
      isHiddenService: false,
      isPrimaryService: false,
      linkedServices: [],
      displayName: '',
      UUID: '0000008D-0000-1000-8000-0026BB765291',
      subtype: undefined,
      [Symbol(kCapture)]: false
    },
    FilterMaintenance {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      iid: null,
      name: null,
      characteristics: [Array],
      optionalCharacteristics: [Array],
      isHiddenService: false,
      isPrimaryService: false,
      linkedServices: [],
      displayName: '',
      UUID: '000000BA-0000-1000-8000-0026BB765291',
      subtype: undefined,
      [Symbol(kCapture)]: false
    },
    Lightbulb {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      iid: null,
      name: null,
      characteristics: [Array],
      optionalCharacteristics: [Array],
      isHiddenService: false,
      isPrimaryService: false,
      linkedServices: [],
      displayName: '',
      UUID: '00000043-0000-1000-8000-0026BB765291',
      subtype: undefined,
      [Symbol(kCapture)]: false
    },
    Switch {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      iid: null,
      name: null,
      characteristics: [Array],
      optionalCharacteristics: [Array],
      isHiddenService: false,
      isPrimaryService: false,
      linkedServices: [],
      displayName: '',
      UUID: '00000049-0000-1000-8000-0026BB765291',
      subtype: undefined,
      [Symbol(kCapture)]: false
    }
  ],
  reachable: false,
  context: {
    deviceApiName: '52b3d525-bfbb-4d0b-b6a3-2052927e06ab',
    uuid: '1f097e0e-a999-4977-939b-53bc48dd9fcb',
    mac: '7c:9e:bd:2e:04:00',
    configuration: {
      df: [Object],
      di: [Object],
      _ot: 'CmConfig',
      _f: false,
      _it: 'urn:blueair:openapi:version:healthprotect:0.0.5',
      _eid: '91d03865-11f3-11ec-8fb8-35def321e829',
      _sc: 'Instance',
      ds: [Object],
      _r: 'us-east-2',
      _s: [Object],
      _t: 'Diff',
      _v:<PHONE_NUMBER>,
      _cas:<PHONE_NUMBER>,
      _id: '1f097e0e-a999-4977-939b-53bc48dd9fcb',
      fc: [Object],
      da: [Object],
      dc: [Object]
    },
    sensorData: { pm2_5: '0', fsp0: '11' },
    attributes: {
      cfv: 33554957,
      filterusage: 7,
      brightness: 100,
      standby: false,
      fanspeed: 11,
      nightmode: false,
      childlock: false,
      mfv: 33554953,
      ofv: 33554957,
      automode: true,
      online: true
    }
  },
  _associatedHAPAccessory: Accessory {
    _events: [Object: null prototype] { identify: [Function (anonymous)] },
    _eventsCount: 1,
    _maxListeners: undefined,
    displayName: 'Office Purifier',
    UUID: '7ab5f7f1-77f1-4134-9952-be75eba0dd27',
    aid: null,
    _isBridge: false,
    bridged: false,
    bridgedAccessories: [],
    reachable: true,
    category: 1,
    services: [
      [AccessoryInformation],
      [AirPurifier],
      [AirQualitySensor],
      [FilterMaintenance],
      [Lightbulb],
      [Switch]
    ],
    shouldPurgeUnusedIDs: true,
    initialized: false,
    controllers: {},
    _setupID: null,
    controllerStorage: ControllerStorage {
      initialized: false,
      fileCreated: false,
      purgeUnidentifiedAccessoryData: true,
      trackedControllers: [],
      controllerData: {},
      accessoryUUID: '7ab5f7f1-77f1-4134-9952-be75eba0dd27'
    },
    lastAccessoriesRequest: 0,
    getPrimaryAccessory: [Function (anonymous)],
    configurationChangeDebounceTimeout: undefined,
    [Symbol(kCapture)]: false
  },
  displayName: 'Office Purifier',
  UUID: '7ab5f7f1-77f1-4134-9952-be75eba0dd27',
  category: 1,
  [Symbol(kCapture)]: false
}
[14/04/2022, 18:01:09] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null

@PeytonRG  Thanks for the logs! Should be fixed with the last commit https://github.com/fjs21/homebridge-blueair/pull/16/commits/8eaa935672e4a38eb7c2a7d0844c22e9b79716f3, so standby for a new version shortly.

@PeytonRG are you using homebridge UI and separating plugins with child bridges? So far this has kept homebridge from crashing under similar circumstances for me and makes restating one plugin a lot easier.
@jonato1  looking forward to trialing the new version.

@jonato1 Also failing with a TypeError on an undefined property with my DustMagnet 5240i, and causing HomeBridge to restart in a loop. Logs below

@A-vesalius No but I was able to just disable the blueair plugin and get it back into a working state without any trouble.

Updated to latest and still not getting a usable accessory so far.
4/14/2022, 9:35:15 PM] [@fjs21/homebridge-blueair] Restarting child bridge...
[4/14/2022, 9:35:15 PM] Got SIGTERM, shutting down child bridge process...
[4/14/2022, 9:35:20 PM] [@fjs21/homebridge-blueair] Child bridge process ended
[4/14/2022, 9:35:20 PM] [@fjs21/homebridge-blueair] Process Ended. Code: 143, Signal: null
[4/14/2022, 9:35:23 PM] [GuestRM AppleTV] Characteristic On 1
[4/14/2022, 9:35:23 PM] [Patio AppleTV] Characteristic Off 0
[4/14/2022, 9:35:23 PM] [Master AppleTV] Characteristic On 1
[4/14/2022, 9:35:24 PM] [SunRM AppleTV] Characteristic On 1
[4/14/2022, 9:35:24 PM] [LivingRM AppleTV] Characteristic On 1
[4/14/2022, 9:35:27 PM] [@fjs21/homebridge-blueair] Restarting Process...
[4/14/2022, 9:35:27 PM] [@fjs21/homebridge-blueair] Launched child bridge with PID 79871
[4/14/2022, 9:35:29 PM] Registering platform<EMAIL_ADDRESS>[4/14/2022, 9:35:29 PM] [@fjs21/homebridge-blueair] Loaded @fjs21/homebridge-blueair v1.0.3 child bridge successfully
[4/14/2022, 9:35:29 PM] Loaded 1 cached accessories from cachedAccessories.0E18C559696C.
[4/14/2022, 9:35:29 PM] [@fjs21/homebridge-blueair] base_API_url<EMAIL_ADDRESS>[4/14/2022, 9:35:29 PM] [@fjs21/homebridge-blueair] Loading accessory from cache: Living Room Purifier
[4/14/2022, 9:35:29 PM] Homebridge v1.4.0 (HAP v0.10.0) (@fjs21/homebridge-blueair) is running on port 34118.
[4/14/2022, 9:35:29 PM] [@fjs21/homebridge-blueair] Got homehost: api-us-east-1.blueair.io
[4/14/2022, 9:35:30 PM] [@fjs21/homebridge-blueair] x-auth-token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InJhcHR1cmUtYm9naWUweEBpY2xvdWQuY29tIiwianRpIjoiYzUyZmEwZjMtMDdkNC00OWM3LTliZTItYzQ5YTcxYWZlYzQ5IiwiZXhwIjoxNjgxNTI2MTMwMDc3LCJleHBpcmF0aW9uRGF0ZSI6MTY4MTUyNjEzMDA3N30.WEtA9c1_byOVAkA3FW5MYyo5U_fVHq8bE02fbj-4aN0
[4/14/2022, 9:35:30 PM] [@fjs21/homebridge-blueair] Found 0 devices.
[4/14/2022, 9:35:30 PM] [@fjs21/homebridge-blueair] ** AWS login begin **
[4/14/2022, 9:35:30 PM] [@fjs21/homebridge-blueair] Headers: Headers {
  _headers: {
    'content-type': [ 'text/javascript; charset=utf-8' ],
    'content-length': [ '758' ],
    'cache-control': [ 'private' ],
    'content-encoding': [ 'gzip' ],
    vary: [ 'Accept-Encoding' ],
    p3p: [ 'CP="IDC COR PSA DEV ADM OUR IND ONL"' ],
    'x-soa': [ 'true, Gator' ],
    'x-server': [ 'us1d-nomad-g3' ],
    'x-callid': [ '0b33fd0f57fc49acb735a2c26e78211f' ],
    'x-robots-tag': [ 'none' ],
    date: [ 'Fri, 15 Apr 2022 02:35:29 GMT' ],
    connection: [ 'keep-alive' ],
    'server-timing': [ 'cdn-cache; desc=MISS, edge; dur=39, origin; dur=108' ]
  }
}
[4/14/2022, 9:35:30 PM] [@fjs21/homebridge-blueair] JWT Headers: Headers {
  _headers: {
    'content-type': [ 'text/javascript; charset=utf-8' ],
    'content-length': [ '802' ],
    'cache-control': [ 'private' ],
    'content-encoding': [ 'gzip' ],
    vary: [ 'Accept-Encoding' ],
    p3p: [ 'CP="IDC COR PSA DEV ADM OUR IND ONL"' ],
    'x-soa': [ 'true, Gator' ],
    'x-server': [ 'us1d-nomad-g21' ],
    'x-callid': [ 'a962b2f65ade45458bbce34e3979ef7a' ],
    'x-robots-tag': [ 'none' ],
    date: [ 'Fri, 15 Apr 2022 02:35:29 GMT' ],
    connection: [ 'keep-alive' ],
    'server-timing': [ 'cdn-cache; desc=MISS, edge; dur=37, origin; dur=54' ]
  }
}
[4/14/2022, 9:35:30 PM] [@fjs21/homebridge-blueair] Execute Headers: Headers {
  _headers: {
    date: [ 'Fri, 15 Apr 2022 02:35:30 GMT' ],
    'content-type': [ 'application/json' ],
    'content-length': [ '2999' ],
    connection: [ 'keep-alive' ],
    'x-amzn-requestid': [ '9b663779-f528-44be-8e18-6350a9d0955a' ],
    'content-encoding': [ 'gzip' ],
    'strict-transport-security': [ '3000' ],
    'content-security-policy': [ "default-src 'none'" ],
    'x-amz-apigw-id': [ 'Qmb92E6GCYcF0Dg=' ],
    'x-amzn-remapped-server': [ '' ],
    'x-content-type-options': [ 'nosniff' ],
    'x-custom-header': [ 'application/json' ],
    'x-amzn-trace-id': [ 'Root=1-6258d9f2-1e22efb63b88be942e1cad05' ]
  }
}
[4/14/2022, 9:35:30 PM] [@fjs21/homebridge-blueair] ** AWS login end **
[4/14/2022, 9:35:31 PM] [@fjs21/homebridge-blueair] ** AWS devices - begin **
[4/14/2022, 9:35:31 PM] [@fjs21/homebridge-blueair] {
  devices: [
    {
      'mcu-firmware': '2.3.0',
      'wifi-firmware': '2.2.23',
      mac: 'c4:dd:57:7f:36:94',
      name: '52457c8f-bcf2-4ae4-b7e0-5333b0c8aba7',
      type: 'B4',
      uuid: '17827a8e-0971-468b-9623-aa495a0573e4'
    }
  ]
}
[4/14/2022, 9:35:31 PM] [@fjs21/homebridge-blueair] Found 1 devices.
[4/14/2022, 9:35:31 PM] [@fjs21/homebridge-blueair] ** AWS devices - end **
[4/14/2022, 9:35:31 PM] [@fjs21/homebridge-blueair] Restoring existing accessory from cache: Living Room Purifier
[4/14/2022, 9:35:32 PM] [@fjs21/homebridge-blueair] Response Headers for Initial Call:  Headers {
  _headers: {
    'content-encoding': [ 'gzip' ],
    'content-length': [ '1577' ],
    'content-type': [ 'application/json' ],
    'x-amz-apigw-id': [ 'Qmb-GEVaiYcFa5A=' ],
    'x-amzn-requestid': [ '5725e1a5-4f4c-454c-aa52-d7947595437a' ],
    'x-amzn-trace-id': [ 'Root=1-6258d9f3-4600af44544631d54935aa5e' ],
    connection: [ 'keep-alive' ],
    date: [ 'Fri, 15 Apr 2022 02:35:32 GMT' ]
  }
}
[4/14/2022, 9:35:32 PM] [@fjs21/homebridge-blueair] Response Body for Initial Call:  [
  {
    alarms: [],
    configuration: {
      _cas:<PHONE_NUMBER>,
      _eid: '9e88402a-a10a-4c67-bd53-f2a041247296',
      _f: false,
      _id: '17827a8e-0971-468b-9623-aa495a0573e4',
      _it: 'urn:blueair:openapi:version:healthprotect:0.0.5',
      _ot: 'CmConfig',
      _r: 'us-east-2',
      _s: [Object],
      _sc: 'Instance',
      _t: 'Partial',
      _v:<PHONE_NUMBER>,
      da: [Object],
      dc: [Object],
      df: [Object],
      di: [Object],
      ds: [Object],
      fc: [Object]
    },
    events: [],
    id: '17827a8e-0971-468b-9623-aa495a0573e4',
    sensordata: [ [Object], [Object] ],
    states: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object]
    ],
    welcomehome: { setting: [] }
  }
]
[4/14/2022, 9:35:32 PM] [@fjs21/homebridge-blueair] Response Body for Initial Call:  {
  alarms: [],
  configuration: {
    _cas:<PHONE_NUMBER>,
    _eid: '9e88402a-a10a-4c67-bd53-f2a041247296',
    _f: false,
    _id: '17827a8e-0971-468b-9623-aa495a0573e4',
    _it: 'urn:blueair:openapi:version:healthprotect:0.0.5',
    _ot: 'CmConfig',
    _r: 'us-east-2',
    _s: {
      salg: 'SHA256withECDSA',
      sig: 'd96f785c794c302be91f643bac01a746409218b8bfb52dcd476ba8bb7cee61fd'
    },
    _sc: 'Instance',
    _t: 'Partial',
    _v:<PHONE_NUMBER>,
    da: {
      am: [Object],
      buttontest: [Object],
      chl: [Object],
      fsp0: [Object],
      is: [Object],
      ledb: [Object],
      nm: [Object],
      reboot: [Object],
      sb: [Object],
      sflu: [Object],
      uitest: [Object]
    },
    dc: {
      automode: [Object],
      brightness: [Object],
      cfv: [Object],
      childlock: [Object],
      fanspeed: [Object],
      filterusage: [Object],
      mfv: [Object],
      nightmode: [Object],
      ofv: [Object],
      standby: [Object]
    },
    df: { a: 877, alg: 'FilterAlg1', fsfc: 12000000, ot: 'B4Filter' },
    di: {
      cfv: '2.2.23',
      cma: 'c4:dd:57:7f:36:94',
      ds: '110694303001110710000729',
      hw: 'b4basic_m_1.1',
      mfv: '2.3.0',
      mt: '1',
      name: 'Living Room Purifier',
      ofv: '2.2.23',
      sku: '106943'
    },
    ds: {
      am: [Object],
      b5m: [Object],
      chl: [Object],
      fsp0: [Object],
      fu0: [Object],
      is: [Object],
      ledb: [Object],
      nm: [Object],
      pm2_5: [Object],
      rssi: [Object],
      rt1s: [Object],
      rt5m: [Object],
      rt5s: [Object],
      sb: [Object],
      sp: [Object]
    },
    fc: { bssid: '', pwd: '9102revreSyrotcaF', ssid: '', url: '' }
  },
  events: [],
  id: '17827a8e-0971-468b-9623-aa495a0573e4',
  sensordata: [
    { n: 'pm2_5', t:<PHONE_NUMBER>, v: '0' },
    { n: 'fsp0', t:<PHONE_NUMBER>, v: '11' }
  ],
  states: [
    { n: 'cfv', t:<PHONE_NUMBER>, v: 33554967 },
    { n: 'filterusage', t:<PHONE_NUMBER>, v: 19 },
    { n: 'brightness', t:<PHONE_NUMBER>, v: 9 },
    { n: 'standby', t:<PHONE_NUMBER>, vb: false },
    { n: 'fanspeed', t:<PHONE_NUMBER>, v: 11 },
    { n: 'nightmode', t:<PHONE_NUMBER>, vb: false },
    { n: 'childlock', t:<PHONE_NUMBER>, vb: false },
    { n: 'mfv', t:<PHONE_NUMBER>, v: 33555200 },
    { n: 'ofv', t:<PHONE_NUMBER>, v: 33554967 },
    { n: 'automode', t:<PHONE_NUMBER>, vb: true },
    { n: 'online', t:<PHONE_NUMBER>, vb: true }
  ],
  welcomehome: { setting: [] }
}
[4/14/2022, 9:35:32 PM] [@fjs21/homebridge-blueair] Response Body for Initial Call:  'Living Room Purifier'
[4/14/2022, 9:35:32 PM] [@fjs21/homebridge-blueair] Response Body for Initial Call:  [
  { n: 'pm2_5', t:<PHONE_NUMBER>, v: '0' },
  { n: 'fsp0', t:<PHONE_NUMBER>, v: '11' }
]
[4/14/2022, 9:35:32 PM] [@fjs21/homebridge-blueair] Response Body for Initial Call:  [
  { n: 'cfv', t:<PHONE_NUMBER>, v: 33554967 },
  { n: 'filterusage', t:<PHONE_NUMBER>, v: 19 },
  { n: 'brightness', t:<PHONE_NUMBER>, v: 9 },
  { n: 'standby', t:<PHONE_NUMBER>, vb: false },
  { n: 'fanspeed', t:<PHONE_NUMBER>, v: 11 },
  { n: 'nightmode', t:<PHONE_NUMBER>, vb: false },
  { n: 'childlock', t:<PHONE_NUMBER>, vb: false },
  { n: 'mfv', t:<PHONE_NUMBER>, v: 33555200 },
  { n: 'ofv', t:<PHONE_NUMBER>, v: 33554967 },
  { n: 'automode', t:<PHONE_NUMBER>, vb: true },
  { n: 'online', t:<PHONE_NUMBER>, vb: true }
]
[4/14/2022, 9:35:32 PM] [@fjs21/homebridge-blueair] Device Info from findAwsModelAndInitialize:  [
  {
    id: '17827a8e-0971-468b-9623-aa495a0573e4',
    configuration: {
      df: [Object],
      di: [Object],
      _ot: 'CmConfig',
      _f: false,
      _it: 'urn:blueair:openapi:version:healthprotect:0.0.5',
      _eid: '9e88402a-a10a-4c67-bd53-f2a041247296',
      _sc: 'Instance',
      ds: [Object],
      _r: 'us-east-2',
      _s: [Object],
      _t: 'Partial',
      _v:<PHONE_NUMBER>,
      _cas:<PHONE_NUMBER>,
      _id: '17827a8e-0971-468b-9623-aa495a0573e4',
      fc: [Object],
      da: [Object],
      dc: [Object]
    },
    alarms: [],
    events: [],
    sensordata: [ [Object], [Object] ],
    states: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object]
    ],
    welcomehome: { setting: [] }
  }
]
[4/14/2022, 9:35:32 PM] [@fjs21/homebridge-blueair] 52457c8f-bcf2-4ae4-b7e0-5333b0c8aba7: device type not recognized, contact developer via GitHub.
[4/14/2022, 9:35:32 PM] [@fjs21/homebridge-blueair] This device is not yet supported. Device Type:  b4basic_m_1.1```

@PeytonRG @shbisson Looks like @fjs21 was able to publish a new version (1.0.2) to npm. Let me know how things look once you update.
@A-vesalius Looks like this is due to the model # in the API reading slightly different. This should be fixed in the next release. Thanks for your patience; kinda coding in the dark a bit since the API documentation from Blueair is a bit non-existent.

On 1.0.3 it's working for me now with the 5240i. I'm able to turn on/off, control LED brightness, fan speed, and toggle night mode. One thing I'm noticing though is that turning night mode off resets fan speed to 1. I know setting a schedule for night mode returns it back to the previous setting once the time is up. In my case that's auto. It would be cool if you could somehow track the previous state to emulate this.
Alternatively, and probably easier to implement, would just be to turn on auto. I remember that endpoint being in your collection @jonato1 but I'm not seeing a control for it in HomeKit. If I had that I could automate it myself.

Only other thing I noticed is that there's an excessive amount of logging while Homebridge debugging is disabled, which might be something to bring up to @fjs21. Great work!

@jonato1 nothing but thanks for your work.

On 1.0.3 it's working for me now with the 5240i. I'm able to turn on/off, control LED brightness, fan speed, and toggle night mode. One thing I'm noticing though is that turning night mode off resets fan speed to 1. I know setting a schedule for night mode returns it back to the previous setting once the time is up. In my case that's auto. It would be cool if you could somehow track the previous state to emulate this.
Alternatively, and probably easier to implement, would just be to turn on auto. I remember that endpoint being in your collection @jonato1 but I'm not seeing a control for it in HomeKit. If I had that I could automate it myself.

This is great news, Peyton! That would be interesting to store the previous setting and then restore it. In the meantime, the Auto mode should be surfaced in HomeKit. Try the following to see if it works for you:

Go to Home.app >  click on Air Purifier > click on Setting gear in bottom right >  Click Accessories > Show the controls for the Air Purifier, and find the "Auto" vs. "Manual" mode toggle. (see image below)
OR, just use Siri to say "Set [insert name of air purifier] to Auto"

Ok yes I was looking on the parent tile instead of that. It's working for me! I ought to be able to automate that @jonato1

Only other thing I noticed is that there's an excessive amount of logging while Homebridge debugging is disabled, which might be something to bring up to @fjs21. Great work!

Definitely a great point - that is one of the TODO items for sure. I figured I would try to heir on more logging for now given the "coding in the dark" situation of not knowing what the Blueair AWS APIs might return differently between different models.

Just tested out a leave/arrive automation to turn it off/back on at auto and it worked perfectly. Cannot thank you enough for this!

Only other thing I noticed is that there's an excessive amount of logging while Homebridge debugging is disabled, which might be something to bring up to @fjs21. Great work!

Definitely a great point - that is one of the TODO items for sure. I figured I would try to heir on more logging for now given the "coding in the dark" situation of not knowing what the Blueair AWS APIs might return differently between different models.

One thing you can do - is change the verbose log (JSON) commands in the blueair-api.ts (and elsewhere) from  'this.log.info' to 'this.log.debug'. This way a user can only see these if they turn on the full logging using the Homebridge UI.
Having said that, I think while AWS support is still being actively worked on having more rather than less logging is useful.
Last, make sure you always "info" what we need to add support for new devices and then that can be moved over to #6.

@A-vesalius v1.0.4 is hot off the press - let me know if it works (I'm hoping it does!) If not, please include logs and I'd be happy to troubleshoot with you.
Best,
Jon

with 1.0.4 my slightly different DustMagnet 5410i device ID  is up and running thanks much.

@A-vesalius Looks like this is due to the model # in the API reading slightly different. This should be fixed in the next release. Thanks for your patience; kinda coding in the dark a bit since the API documentation from Blueair is a bit non-existent.

@Reevak05 @tkundhi @Bubbgump209 @shbisson I believe you all have the HealthProtect purifier, but varying models. Let me know how v1.0.4 goes for you all. Please share the logs if you have any issues - I foresee there will be at least one hardware model that I missed.
Thanks!

As of this morning I'm getting a new error
[16/04/2022, 10:31:37] [BlueAir] Response Body for Initial Call:  undefined
[16/04/2022, 10:31:37] [BlueAir] Office Purifier: getDeviceInfo error. TypeError: Cannot read properties of undefined (reading '0')
    at BlueAirApi.getAwsDeviceInfo (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/blueair-api.ts:677:93)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at BlueAirDustProtectAccessory.updateDevice (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory_DustProtect.ts:135:20)
    at BlueAirDustProtectAccessory.updateAccessoryCharacteristics (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory_DustProtect.ts:262:29)
    at BlueAirDustProtectAccessory.handleNightModeGet (/usr/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory_DustProtect.ts:240:5)
[16/04/2022, 10:31:37] [BlueAir] updateAccessoryCharacteristic failed (1f097e0e-a999-4977-939b-53bc48dd9fcb)
[16/04/2022, 10:31:44] [BlueAir] Body {
  _abort: false,
  _bytes: 60,
  _raw: [
    <Buffer 7b 22 4d 65 73 73 61 67 65 22 3a 22 55 73 65 72 20 69 73 20 6e 6f 74 20 61 75 74 68 6f 72 69 7a 65 64 20 74 6f 20 61 63 63 65 73 73 20 74 68 69 73 20 ... 10 more bytes>
  ],
  body: Gunzip {
    [Symbol(kCallback)]: null,
    [Symbol(kCapture)]: false,
    [Symbol(kError)]: null,
    _chunkSize: 16384,
    _defaultFlushFlag: 0,
    _defaultFullFlushFlag: 3,
    _events: [Object: null prototype] {
      data: [Function (anonymous)],
      end: [Function (anonymous)],
      error: [Function (anonymous)],
      prefinish: [Function: prefinish]
    },
    _eventsCount: 4,
    _finishFlushFlag: 4,
    _handle: null,
    _info: undefined,
    _level: -1,
    _maxListeners: undefined,
    _maxOutputLength:<PHONE_NUMBER>,
    _outBuffer: <Buffer 7b 22 4d 65 73 73 61 67 65 22 3a 22 55 73 65 72 20 69 73 20 6e 6f 74 20 61 75 74 68 6f 72 69 7a 65 64 20 74 6f 20 61 63 63 65 73 73 20 74 68 69 73 20 ... 16334 more bytes>,
    _outOffset: 60,
    _readableState: ReadableState {
      [Symbol(kPaused)]: false,
      autoDestroy: true,
      awaitDrainWriters: null,
      buffer: BufferList { head: null, length: 0, tail: null },
      closeEmitted: true,
      closed: true,
      constructed: true,
      dataEmitted: true,
      decoder: null,
      defaultEncoding: 'utf8',
      destroyed: true,
      emitClose: true,
      emittedReadable: false,
      encoding: null,
      endEmitted: true,
      ended: true,
      errorEmitted: false,
      errored: null,
      flowing: true,
      highWaterMark: 16384,
      length: 0,
      multiAwaitDrain: false,
      needReadable: false,
      objectMode: false,
      pipes: [],
      readableListening: false,
      reading: false,
      readingMore: false,
      resumeScheduled: false,
      sync: false
    },
    _strategy: 0,
    _writableState: WritableState {
      [Symbol(kOnFinished)]: [],
      afterWriteTickInfo: null,
      allBuffers: true,
      allNoop: true,
      autoDestroy: true,
      bufferProcessing: false,
      buffered: [],
      bufferedIndex: 0,
      closeEmitted: true,
      closed: true,
      constructed: true,
      corked: 0,
      decodeStrings: true,
      defaultEncoding: 'utf8',
      destroyed: true,
      emitClose: true,
      ended: true,
      ending: true,
      errorEmitted: false,
      errored: null,
      finalCalled: true,
      finished: true,
      highWaterMark: 16384,
      length: 0,
      needDrain: false,
      objectMode: false,
      onwrite: [Function: bound onwrite],
      pendingcb: 0,
      prefinished: true,
      sync: false,
      writecb: null,
      writelen: 0,
      writing: false
    },
    _writeState: Uint32Array(2) [ 16324, 0 ],
    allowHalfOpen: true,
    bytesWritten: 78
  },
  bodyUsed: true,
  headers: Headers {
    _headers: {
      'content-encoding': [ 'gzip' ],
      'content-length': [ '78' ],
      'content-type': [ 'application/json' ],
      'x-amz-apigw-id': [ 'QrgnDFnJiYcFioA=' ],
      'x-amzn-errortype': [ 'AccessDeniedException' ],
      'x-amzn-requestid': [ 'd0198bfc-b7f4-4288-ab03-be4b47e3342f' ],
      'x-amzn-trace-id': [ 'Root=1-625ae160-4f11ee0753fcfc475a77f669' ],
      connection: [ 'keep-alive' ],
      date: [ 'Sat, 16 Apr 2022 15:31:44 GMT' ]
    }
  },
  ok: false,
  size: 0,
  status: 403,
  statusText: 'Forbidden',
  timeout: 0,
  url: 'https://on1keymlmh.execute-api.us-east-2.amazonaws.com/prod/c/1f097e0e-a999-4977-939b-53bc48dd9fcb/a/nightmode'
}

@PeytonRG if you restart Homebridge, does the issue resolve itself temporarily?
If so, I think this may have to do with the Access Token expiring...if I'm right, I'll have to revisit login logic to either use the refresh token to get a new access token, or completely restart the logging to get a new JWT and in turn a new access token.

Would it be possible to add support for the Health Protect 7710i?  The latest version gets the tile to show up in HomeKit but says the accessory is not supported. If you need any more information (logs, etc…), please let me know.

@PeytonRG I think I finally ran into the same issue that you did. Restarting homebridge worked as a temporary fix, but I'm going to open up a new issue to track this.

@jonato1 , I finally got a chance to check out the latest release. Overall it is working but I too have some errors.
[23/04/2022, 15:26:28] [BlueAir] Response Body for Initial Call:  undefined
[23/04/2022, 15:26:28] [BlueAir] Odin: getDeviceInfo error. TypeError: Cannot read properties of undefined (reading '0')
at BlueAirApi.getAwsDeviceInfo (/usr/local/lib/node_modules/@fjs21/homebridge-blueair/src/blueair-api.ts:677:93)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at BlueAirDustProtectAccessory.updateDevice (/usr/local/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory_DustProtect.ts:135:20)
at BlueAirDustProtectAccessory.updateAccessoryCharacteristics (/usr/local/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory_DustProtect.ts:262:29)
at BlueAirDustProtectAccessory.handleCurrentAirPurifierStateGet (/usr/local/lib/node_modules/@fjs21/homebridge-blueair/src/platformAccessory_DustProtect.ts:195:5)
[23/04/2022, 15:26:28] [BlueAir] updateAccessoryCharacteristic failed (1f82bd45-a605-4ae2-8fa8-ae8c55b2ab85)
I think this is the same that @PeytonRG reported. But one item that is different for me is the Model. It is being reported as DustProtect when the actual model is HealthProtect. The HealthProtect models are: 7410, 7470, 7710, 7770. One thing to note, BlueAir recent renamed all the HealthProtect to simply Protect.
The other odd behavior was if I turn off the unit via Homebridge and then back on, it restarts in a completely different mode. I need to go back into the BlueAir app and adjust the settings. Basically I run my unit on Auto with all the display and lights turned off.

@tkundhi Thanks for the update! those logs definitely seem similar to what Peyton shared. I created #18 to track that issue.

But one item that is different for me is the Model. It is being reported as DustProtect when the actual model is HealthProtect.

Can you clarify what you are referring to in the logs here? Is it the platformAccessory_DustProtect.ts in the logs? If so, that is purely a naming convention that I need to change - definitely technical debt on my end.
As for the the turning the unit back on, I want to make sure I understand the behavior correctly. Are you saying that you will turn the unit on, set to Auto, turn all of the lights off...and then if you turn the unit off and back on with the Home.app/Homebridge, then the display/lights come back on?

@jonato1 Are you ok with me closing this issue now? I think it makes more sense for users to start new issues that crop up with either the classic API or the AWS-based API.

@fjs21 Yes, I'm fine with that. Thanks!

Hi Jon, I imported and successfully ran the collection. It reports back a
device. I've saved the Get Devices and Get State responses. Let me know if
you need them. All the Service requests came back as "Success"
Thanks for making it easy to test locally. I don't use Postman regularly
and didn't keep notes on how I set it up to do my previous tests, so I
haven't had time to go back and reconfigure things to have homebridge proxy
through Postman. Let me know if you need me to do anything else.
t.
On Thu, Apr 7, 2022 at 11:33 AM Jon @.***> wrote:

@tkundhi https://github.com/tkundhi Can you try importing the Postman
collection I linked to above and see if it works for your HealthProtect?
@KirkDahl https://github.com/KirkDahl @PeytonRG
https://github.com/PeytonRG It looks like you both have other versions
of DustProtect - I assume the API endpoints work the same as mine (5210i)
does, but if you are familiar with using the Postman application, let me
know if it does indeed work or not.
—
Reply to this email directly, view it on GitHub
https://github.com/fjs21/homebridge-blueair/issues/1#issuecomment-1091961567,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AITSMBY3C6ZWRLE2HMHP4XDVD4E3TANCNFSM5IECWHJA
.
You are receiving this because you were mentioned.Message ID:
@.***>


Date picker, range slider, combobox?

It would be great to have UI features like:

date picker - http://www.getuikit.com/docs/addons_datepicker.html
range slider - http://jqueryui.com/slider/
combobox (dropdownmenu with autosearch function) - http://jqueryui.com/autocomplete/#combobox

Thank you

+1


jdsl selectFrom function

Backgrounds

queryDSL has selectFrom function and users migrating from QueryDSL to Kotlin-JDSL are forced to use the select() from() functions or develop an selectFrom extension function and use

Requirements

adding the 'selectFrom' function to the 'Jdsl' class makes it easier for people to use JDSL

Example
    authorRepository.findAll {
          selectFrom(
              entity(Author::class),
              leftJoin(BookAuthor::class).on(path(Author::authorId).equal(path(BookAuthor::authorId))),
          ).where(
              path(BookAuthor::authorId).isNull(),
          ).orderBy(
              path(Author::authorId).asc(),
          )
      }

Hi @kihwankim. Thanks for the suggestion!
I'm hesitant to add the selectFrom function to Jdsl because it might lead to misunderstandings about the purpose of the library. Jdsl is designed to closely reflect the target language, and adding custom expressions might make users think we're abstracting that language too much. Ideally, users should have the freedom to create their own Custom DSLs that fit their personal style.
Also, Jdsl and QueryDSL have different approaches. In QueryDSL, you can chain methods after selectFrom to add joins, but this isn't possible in Jdsl. Using variable arguments in selectFrom seems to enforce a specific way of using it, which can be confusing. For example, it's unclear whether joins are included in what selectFrom returns just by looking at the method. This confusion arises because selectFrom is a unique construct of the library, not a standard method. This could lead us to respond to various user requests, such as supporting selectFrom().join() or allowing multiple where clauses, which can complicate decision-making.
However, if many users want selectFrom, I'm open to considering it, provided we have a clear vision for the future. Otherwise, the DSL might become too complex to enhance later on. I think it would be worth discussing further if this issue gets about 20 👍, which is about 3% of our current stars.

@shouwn  Thank you!
I'm leaving a comment to appeal my opinion once again in case this issue gets a lot of 👍 and becomes a subject of consideration.
Each individual may have a different style, but when calling the 'select' function about entity, the from function often adds the same entity. And we developed a lot by adding fetchJoin if necessary.
since the select from function is repeated, people created and used a class that inherited the Jpql open class and add a selectFrom function or define it through an extended function to simplify logic.
In the process of repeated work, I thought it would be better if the Kotlin-JDSL Lib could provide that function, so I uploaded issue and PR
--- korean
감사합니다!
다시 이 issue가 👍 를 많이 받아서, 고려 대상이 될 경우를 위해서 저의 의견을 한번 어필 하고자 댓글을 남깁니다.
각 개인 마다 스타일 차이가 있겠지만, entity 단위로 select 할 경우 from도  동일한 entity를 넣는경우가 많습니다. 그리고 필요할 경우 fetchJoin을 추가하는 방식으로 많이 개발하였습니다.
위와 같은 코드가 반복되다 보니 로직을 간소화 하기 위해서 Jpql open class 를 상속받아서 selectFrom 함수를 추가하거나 , 확장함수를 통해서 정의해서 사용하는 경우가 많이 발생하였습니다.
반복된 작업과정에서 jdsl lib 단에서 해당 기능을 제공해주면 좋겠다는 생각이 많이들어서 issue 와 PR을 올리게 되었습니다

This is a personal opinion!
I think it’s a reasonable decision to implement a feature once an issue receives 20 👍 reactions, especially from the perspective of managing open source projects.
However, I believe that even though Kotlin JDSL is not actively maintained as an open source project, it is used directly by a relatively larger number of people.
I’m not sure if this matter has been brought up in the Discord community, but personally, I feel that information dissemination is somewhat lacking.
I think it would be good to spread the word more broadly about the requirement for 20 👍 reactions to check whether the feature will be implemented or not. Thank you!

@esperar As you said, it would be good to make an announcement on Discord or something, since this is a survey. Thank you for the good feedback.
I'll try to make an announcement on Discord sometime next week.

@esperar Sorry it took so long. I left a post on Discord to ask for feedback on this issue.


I have a question about running code. There is an error when running the command torchrun --nproc_per_node=2 scripts/sdxl_example.py. My torch version is 2.2.1, cuda version is 11.8, and python version is 3.10.

[rank1]:[W CUDAGraph.cpp:145] Warning: Waiting for pending NCCL work to finish before starting graph capture. (function operator())
[rank0]:[W CUDAGraph.cpp:145] Warning: Waiting for pending NCCL work to finish before starting graph capture. (function operator())
terminate called after throwing an instance of 'std::runtime_error'
what():  terminate called after throwing an instance of 'NCCL Error 5: invalid usage (run with NCCL_DEBUG=WARN for details)std::runtime_error
'
what():  NCCL Error 5: invalid usage (run with NCCL_DEBUG=WARN for details)
[2024-06-12 03:45:51,447] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: -6) local_rank: 0 (pid: 10453) of binary: /root/anaconda3/envs/distrifuser/bin/python
Traceback (most recent call last):
File "/root/anaconda3/envs/distrifuser/bin/torchrun", line 8, in
sys.exit(main())
File "/root/anaconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 347, in wrapper
return f(*args, **kwargs)
File "/root/anaconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/run.py", line 812, in main
run(args)
File "/root/anaconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/run.py", line 803, in run
elastic_launch(
File "/root/anaconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 135, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/root/anaconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 268, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
scripts/sdxl_example.py FAILED
Failures:
[1]:
time      : 2024-06-12_03:45:51
host      : 692d3f5c0349
rank      : 1 (local_rank: 1)
exitcode  : -6 (pid: 10454)
error_file: <N/A>
traceback : Signal 6 (SIGABRT) received by PID 10454
Root Cause (first observed failure):
[0]:
time      : 2024-06-12_03:45:51
host      : 692d3f5c0349
rank      : 0 (local_rank: 0)
exitcode  : -6 (pid: 10453)
error_file: <N/A>
traceback : Signal 6 (SIGABRT) received by PID 10453

Looks like it is some torchrun and NCCL issue. Are you able to run it with a single GPU?

Yes, I can run it with a single GPU. But when it’s set up for two GPUs, an error occurs.

Weird. Could you try disabling the CUDAGraph to see if it works. You can simply pass use_cuda_graph=False here.

After changing the setting, I found that the error has become the following situation.
“
[rank0]:[W CUDAGraph.cpp:145] Warning: Waiting for pending NCCL work to finish before starting graph capture. (function operator())
[rank1]:[W CUDAGraph.cpp:145] Warning: Waiting for pending NCCL work to finish before starting graph capture. (function operator())
[2024-07-08 06:10:31,482] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: -6) local_rank: 0 (pid: 99442) of binary: /home/meichangwang/miniconda3/envs/distrifuser/bin/python
Traceback (most recent call last):
File "/home/meichangwang/miniconda3/envs/distrifuser/bin/torchrun", line 8, in
sys.exit(main())
File "/home/meichangwang/miniconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 347, in wrapper
return f(*args, **kwargs)
File "/home/meichangwang/miniconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/run.py", line 812, in main
run(args)
File "/home/meichangwang/miniconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/run.py", line 803, in run
elastic_launch(
File "/home/meichangwang/miniconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 135, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/home/meichangwang/miniconda3/envs/distrifuser/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 268, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
scripts/sdxl_example.py FAILED
Failures:
[1]:
time      : 2024-07-08_06:10:31
host      : ubuntu
rank      : 1 (local_rank: 1)
exitcode  : -6 (pid: 99443)
error_file: <N/A>
traceback : Signal 6 (SIGABRT) received by PID 99443
Root Cause (first observed failure):
[0]:
time      : 2024-07-08_06:10:31
host      : ubuntu
rank      : 0 (local_rank: 0)
exitcode  : -6 (pid: 99442)
error_file: <N/A>
traceback : Signal 6 (SIGABRT) received by PID 99442
”


⚠ GitLab Server has degraded performance

In 5e3cd35, GitLab Server (https://gitlab01.its-telekom.eu) experienced degraded performance:

HTTP code: 200
Response time: 4644 ms

Resolved: GitLab Server performance has improved in adfc61b.


OpenVDB does not compile with GCC 6.1.1

Relevant log:
Relevant part (hopefully):

g++ -c -DOPENVDB_PRIVATE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fvisibility=hidden -fvisibility-inlines-hidden -pthread -g -I . -I .. -isystem /usr/include -isystem /usr/include/OpenEXR -isystem /usr/include -isystem /usr/include -isystem /usr/include -DOPENVDB_USE_BLOSC -DOPENVDB_USE_LOG4CPLUS -DOPENVDB_USE_GLFW_3 -fPIC -o Grid.o Grid.cc
In file included from /usr/include/c++/6/ext/string_conversions.h:41:0,
from /usr/include/c++/6/bits/basic_string.h:5402,
from /usr/include/c++/6/string:52,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from Grid.h:34,
from Grid.cc:31:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^
compilation terminated.
make[2]: *** [Grid.o] Error 1

The issue is given in details at: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129

Proper fix would be to avoid using '-isystem /usr/include' in the Makefiles

hi @malaterre, have you succeed build it using gcc 6.1.1?  any workaround? I don't know how to fix it by avoid using -isystem /usr/include

Okay, avoiding use /usr/include did the trick for me but still fail when building vdb_print, etc. Here's the log
make lib install
make: Nothing to be done for 'lib'.
Building vdb_print because of libopenvdb.so.3.2.0 main.cc
g++ -std=c++0x -pthread -O3 -DNDEBUG -I . -I .. -isystem /usr/include/boost -isystem /opt/lib/openexr/include -isystem /usr/include/tbb -isystem /opt/lib/blosc/include -isystem /usr/include/log4cplus -DOPENVDB_USE_BLOSC -DOPENVDB_USE_LOG4CPLUS -DOPENVDB_USE_GLFW_3 -o vdb_print cmd/openvdb_print/main.cc -I . \
    -Wl,-rpath,/opt/lib/openvdb/lib -L/home/aditia/src/blender-deps/openvdb-master/openvdb libopenvdb.so.3.2.0 \
    -ldl -lm -lz -Wl,-rpath,/opt/lib/openexr/lib -L/opt/lib/openexr/lib -lHalf -Wl,-rpath,/usr/lib64 -L/usr/lib64 -ltbb -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lboost_iostreams -lboost_system  -Wl,-rpath,/opt/lib/blosc/lib -L/opt/lib/blosc/lib -lblosc -lz -Wl,-rpath,/usr/lib64 -L/usr/lib64 -llog4cplus -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lrt -ljemalloc
/usr/bin/ld: vdb_print: hidden symbol `__cpu_model' in /usr/lib/gcc/x86_64-redhat-linux/6.1.1/libgcc.a(cpuinfo.o) is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:735: recipe for target 'vdb_print' failed
make: *** [vdb_print] Error 1

This is a duplicate of #144
In short:
Set CMake option to not use isystem for imported targets:
cmake ../src -DCMAKE_NO_SYSTEM_FROM_IMPORTED:BOOL=TRUE

Just for reference, the original post was using the Makefile based build system. I'll switch to cmake for Debian package. Thanks for help !


Adsk Contrib - Fix CDL identity optimization issue

Signed-off-by: Patrick Hodoul<EMAIL_ADDRESS>The pull request fixes a bug related to optimization of CDL Ops.   When an identity CDL_V1_2 style CDL Op was replaced in the optimizer, it was only clamping negative values.  However, since the full op clamps on both sides (0 and 1), per the ASC specification, the identity replacement should also clamp on both sides.
This bug only impacts v2 configs since v1 configs use the previous method of applying CDLs.  Also, it does not affect 'no clamp' CDL style in v2, the optimizer replaces those identities in a way that also does not clamp.

Friendly reminder that the pull request could be merged next Tuesday if no objections.


Show Contributers Detail on Contributers page

Is your feature request related to a problem? Please describe.
On clicking on contributors in Navbar it takes us to page where it shows 404 not found

a
Describe the solution you'd like
Instead of showing 404 not found create a contributed page that showing all the contributor's details which are showing on Homepageshowsshows
Describe alternatives you've considered
No response
Additional context
I want to work on this issue under GSSOC'23. please assign this to me.
Code of Conduct

[X] I agree to follow this project's Code of Conduct

See i have aleady a team member for this work but i want you to do this with best UI work , understood?

and tell me how would long it will take?

Should i Close this one?

Okay , complete it ASAP ! with best UI

Hey @amanjaiman1, I've created a PR for this issue. Please review it.

Imp. - Do Star the repo .


Finish testsuite for Stream

fixed bug with eof()
almost 100% test coverage

I also rewrote tests back to Prophecy, discovering interesting fact - you simply cannot use static variables in callback like this:
$promise->isPending()->will(function () {
            static $pending = true;
            if ($pending) {
                // Schedule a function to simulate an event that resolves the promise.
                Loop\schedule(function () use (&$pending) {
                    $pending = false;
                });
            }
            return $pending;
        });

This is because Prophecy binds closure, which apparently creates new one, with "fresh" static vars:
if ($callback instanceof Closure && method_exists('Closure', 'bind')) {
            $callback = Closure::bind($callback, $object);
        }

        return call_user_func($callback, $args, $object, $method);

In order to fix this issue, I have to use variable from one scope above.

Interesting, well that explains why Prophecy was breaking the test, the promise would never be resolved and it would go into an infinite loop.
This looks great, I'll merge it right away.
I'm going to add a Promise\wait() function to Icicle on the next release (https://github.com/icicleio/Icicle/blob/feature/promise-wait/src/Promise/functions.php#L155) that does exactly what the loop does in some Stream methods, so those methods can be changed to use that function.
For example:
public function write($data)
{
    if (!$this->isWritable()) {
        throw new RuntimeException('Stream is not writable');
    }

    try {
        return Promise\wait($this->stream->write($data));
    } catch (Exception $exception) {
        throw new RuntimeException('Error writing to stream', 0, $exception);
    }
}

On an unrelated topic, do you think Loop\schedule() should be renamed to Loop\queue()? That name seems to better match its behavior.

Yes, looking at docblock description of schedule(), queue() would be more informative.


Will the relevant training code be made public in the future?

Hello! This is really a good piece of work. Will the related training and fine-tuning code be open sourced in the future? The data of our usage scenario is relatively special, and we want to try the effect of fine-tuning. Thank you so much.

Sorry! It's an amazing job！ I thought the visual parameters of the clip used were fine-tuned.

Hello! This is really a good piece of work. Will the related training and fine-tuning code be open sourced in the future? The data of our usage scenario is relatively special, and we want to try the effect of fine-tuning. Thank you so much.

As a zero-shot method, our MuSc uses a pre-trained image encoder of CLIP as the feature extractor, requiring no additional training and fine-tuning.
Our code will automatically download the pre-trained model, or you can download the pre-trained ViT of CLIP and DINO via the official projects below.
CLIP: https://github.com/mlfoundations/open_clip
DINO: https://github.com/facebookresearch/dino
DINO_v2: https://github.com/facebookresearch/dinov2

This is really amazing. I initially thought it would require at least fine-tuning on industrial datasets. Thank you for your explanation.

Hello! This is really a good piece of work. Will the related training and fine-tuning code be open sourced in the future? The data of our usage scenario is relatively special, and we want to try the effect of fine-tuning. Thank you so much.

Did you find any method for fine-tuning this model on another dataset?


[DonotMerge] Azure Databricks Operator

Thanks submitting your Operator. Please check below list before you create your Pull Request.
New Submissions

[ ] Have you selected the Project Community Operator Submissions in your PR on the right-hand menu bar?
[ ] Are you familiar with our contribution guidelines?
[ ] Have you packaged and deployed your Operator for Operator Framework?

[ ] Have you tested your Operator in all supported installation modes?

Updates to existing Operators

[ ] Is your new CSV pointing to the previous version with the replaces property?
[ ] Is your new CSV referenced in the appropriate channel defined in the package.yaml ?
[ ] Have you tested an update to your Operator when deployed via OLM?

Your submission should not

[ ] Modify more than one operator
[ ] Submit operators to both upstream-community-operators and community-operators at once
[ ] Modify any files outside the above mentioned folders
[ ] Contain more than one commit. Please squash your commits.

Operator Description must contain (in order)

[ ] Description about the managed Application and where to find more information
[ ] Features and capabilities of your Operator and how to use it
[ ] Any manual steps about potential pre-requisites for using your Operator

Operator Metadata should contain

[ ] Human readable name and 1-liner description about your Operator
[x] Valid category name1
[ ] One of the pre-defined capability levels2
[x] Links to the maintainer, source code and documentation
[x] Example templates for all Custom Resource Definitions intended to be used
[x] A quadratic logo

Remember that you can preview your CSV here.
--
1 If you feel your Operator does not fit any of the pre-defined categories, file a PR against this repo and explain your need
2 For more information see here

/hold

@Azadehkhojandi I put your PR to onhold/do-not-merge status, because you stated it in description. If you are ready, just let us know or use the same command ^ with "cancel" at the end. Please do not forget to fill a form which is in the first post.

@Azadehkhojandi: Important announcement: Flat operator directory structure is obsolete from 23-rd of October 2019, only nested directory structure will be accepted. You can use nested structure before this date also.

closing this as it seems stale. Feel free re-open when you are ready :)