Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect anymore #48

Closed
DanielStockinger opened this issue Dec 11, 2024 · 15 comments
Closed

Cannot connect anymore #48

DanielStockinger opened this issue Dec 11, 2024 · 15 comments

Comments

@DanielStockinger
Copy link

DanielStockinger commented Dec 11, 2024

Hello,

i hat the o365 integration and erything has worked as expected.
now i decided to move forward to the ms-365-Calendar integration.

created a new app registration
image
image

cerated a new client secret
have set the permissions as documented

image

link M365 Account works fine
but during submit i get this error, but calendars.ReadWrite.Shared permissions are set
image

image

Many Thanks for your help
Daniel

@RogerSelwyn
Copy link
Owner

Remove the email address you have put in the shared mailbox field. I assume you don’t want to access a shared mailbox?

@DanielStockinger
Copy link
Author

@RogerSelwyn wow that works. Thank you so much. I agree that was my mistake.

@RogerSelwyn
Copy link
Owner

Just checking. Is yours a personal account? Just trying to think why it don’t pick up that you granted that permission. Need to give a more meaningful error.

@DanielStockinger
Copy link
Author

Hello Roger,

yes it is my personal office account.
I was always watching and searching regarding permissions issues.

@RogerSelwyn
Copy link
Owner

I think you can't use personal for shared account, but I don't think I've got anyway of spotting that it is a personal account, and therefore shared permissions won't work.

@RogerSelwyn RogerSelwyn reopened this Dec 11, 2024
@RogerSelwyn
Copy link
Owner

Need to try to figure a way to capture this.Maybe by retrieving email address for the account, and then comparing to "shared" email address, and reject if the same.

@DanielStockinger
Copy link
Author

maybe a nother issue?

this is my calender configuration:

- cal_id: XXASDJASLDKJALKSDJLA
  entities:
  - device_id: Your family
    end_offset: 24
    name: Your family
    start_offset: 0
    track: true

and what i read from the documentation i should get the elements from the data object

The data attribute provides an array of events for the period defined by the start_offset and end_offset in ms365_calendars_<entity_name>.yaml. Individual array elements can be accessed using the template notation states.calendar.<entity_name>_calendar.attributes.data[0...n].

{% set events = state_attr('calendar.micosoft_365_calendar_std_your_family', 'data') %}
Total events: {{ events | length }}

give me a result of 1, what is not correct
Total events: 1

image

sorry for cross posting :-)

@RogerSelwyn
Copy link
Owner

RogerSelwyn commented Dec 11, 2024

That implies there is only 1 event in the next 24 hours.

Not sure if your code is correct, I don't use HA automation, I use Node Red. But your screenshot only shows one event in the data attribute anyway

@RogerSelwyn
Copy link
Owner

RogerSelwyn commented Dec 11, 2024

And thanks for the coffee :-)

@DanielStockinger
Copy link
Author

thank you so much.
You are right, i thought 24 are 24 events. i set up to 720 and get 17 events.
Many Thanks Roger

@DanielStockinger
Copy link
Author

DanielStockinger commented Dec 11, 2024

And thanks for the coffee :-)

you are welcome. Thank you

@RogerSelwyn
Copy link
Owner

The data attribute provides an array of events for the period defined by the start_offset and end_offset

:-)

@RogerSelwyn
Copy link
Owner

I've added a process that checks if shared_email is the same as logged in user, and then removes the attribute from the config. This will be in the next release.

The check happens after authentication (and token retrieval), because it is only then that it is known what the email address of the logged in user is.

@RogerSelwyn
Copy link
Owner

The change will be in the next 1.1.x release

@RogerSelwyn
Copy link
Owner

I have released a new version with this change in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants