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

prefix in the settings.toml #6

Open
23tom2323 opened this issue Sep 12, 2023 · 7 comments
Open

prefix in the settings.toml #6

23tom2323 opened this issue Sep 12, 2023 · 7 comments

Comments

@23tom2323
Copy link

I don't yet understand what the prefix information in the settings.toml should look like.

owntags/
└── application/
    └── keys/
        ├── prefix-1.keyfile	 # Car1
        ├── prefix-2.keyfile	 # Car2
	├── prefix-2.keyfile	 # Unicorn
	└── prefix-2.keyfile 	 # Dragon

@settings.toml

[tag_options.prefix prefix-1]
[tag_options.prefix prefix-2]
[tag_options.prefix prefix-3]
[tag_options.prefix prefix-4]


tag_name = "prefix-1" # Car1
tag_name = "prefix-2" # Car2
tag_name = "prefix-3" # Unicorn
tag_name = "prefix-4" # Dragon

or should it look like this?

owntags/
└── application/
    └── keys/
        ├── car1.keyfile	 
        ├── car2.keyfile	 
	├── unicorn.keyfile	 
	└── dragon.keyfile 	

@settings.toml

[tag_options.prefix]
tag_name = "car1"  
location = true 
waypoint = false  
timestamp = 1000000001  
radius = false  

[tag_options.prefix]
tag_name = "car2"  
location = true 
waypoint = false  
timestamp = 1000000001  
radius = false  

[tag_options.prefix]
tag_name = "unicorn"  
location = true 
waypoint = false  
timestamp = 1000000001  
radius = false  

[tag_options.prefix]
tag_name = "dragon"  
location = true 
waypoint = false  
timestamp = 1000000001  
radius = false  
@Systm21
Copy link

Systm21 commented Sep 12, 2023

Do you already have prefix files with stored keys? Maybe its a little bit clearer for you, when you have data that you can work with.

Simplified it should something like this (can test it in the afternoon):


[tag_options.car1]
tag_name = "car1"  
location = true 
waypoint = false  
timestamp = 1000000001  
radius = false  

[tag_options.car2]
tag_name = "car2"  
location = true 
waypoint = false  
timestamp = 1000000001  
radius = false  

[tag_options.unicorn]
tag_name = "unicorn"  
location = true 
waypoint = false  
timestamp = 1000000001  
radius = false  

[tag_options.dragon]
tag_name = "dragon"  
location = true 
waypoint = false  
timestamp = 1000000001  
radius = false  

@mrmay-dev
Can i rename the prefixes in the Keyfile? Does it also work?

MUST be
tag_options.dragon
and
tag_name = dragon
Identically?
...or can i rename it with tag_name?

@mrmay-dev
Copy link
Owner

mrmay-dev commented Sep 12, 2023

@Systm21 , you are right that the prefix name ([tag_options.dragon]) MUST match the (tag_name = "dragon"). I think it's redundant and want to work the code so it pulls the prefix from the toml block header.

Yes, changing the prefixes on the keyfile works so long as the name is changed in the settings.toml. I named mine for Minecraft items. LOL

Also, check out the timestamps. Each key must be unique.

My keyfiles are:

  • alex.keys
  • steve.keys
  • sheep.keys

and the corresponding TOML blocks read:

[tag_options.alex]
tag_name = "alex"  
location = true 
waypoint = false  
timestamp = 1000000001  
radius = false  

[tag_options.steve]
tag_name = "steve"  
location = true 
waypoint = false  
timestamp = 1000000002 
radius = false 

[tag_options.sheep]
tag_name = "sheep"  
location = true 
waypoint = false  
timestamp = 1000000003 
radius = false 

That's what OwnTracks uses to track waypoints. If the timestamps are the same, OwnTracks thinks it's the same waypoint.

@Systm21
Copy link

Systm21 commented Sep 12, 2023

Ok, got it. but the timestamps can be anything as long as its unique, just like fakestamps 😁 ?

@mrmay-dev
Copy link
Owner

LOL Love it. Fakestamps!

Yup, any sting of numbers that represent a Unix/Posix date. Honestly, haven't tried future dates... that would be interesting. 😁

@23tom2323
Copy link
Author

23tom2323 commented Sep 15, 2023

Short update. Soon everything will be running. I call up, it goes to the mqtt and the broker gets the data. So far so good.

I noticed in the broker in the objects of the individual ESPs that data is mixed up. For example, data from Unicom is entered into Car. Also changing the
TID, what Systm21 has already mentioned, would be really nice.

But today we're going in Holiday for two weeks. 1000 km there and 1000 km back, so I take a few own tags with me. ;-).

Thank you for your support, I'll be back soon.

Bildschirm­foto 2023-09-15 um 08 07 45

@mrmay-dev
Copy link
Owner

Cool! Hope it gos well.
What app is that screenshot from? Looks interesting.

Tell me about that battery level line that's highlighted. Is it OwnTracks? Been wishing I knew enough to add that into the payload that is sent with the keys.

@Systm21
Copy link

Systm21 commented Sep 22, 2023

What app is that screenshot from? Looks interesting.

It's a smarthomeserver called iobroker, simillar to Home Assistant.

Tell me about that battery level line that's highlighted. Is it OwnTracks? Been wishing I knew enough to add that into the payload that is sent with the keys.

Would you like a full json string to sort out, what you need?

{"_type":"location","BSSID":"be:ef:fe:ed:6f:9a","SSID":"SomeWifi","acc":15,"alt":363,"batt":62,"bs":2,"conn":"w","created_at":1694554648,"lat":49.5132895,"lon":9.4512478,"m":-1,"t":"u","tid":"ab","tst":1694553859,"vac":1,"vel":0}

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

3 participants