Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robertraaijmakers committed Feb 3, 2025
1 parent 4b3bc43 commit e7fd4b7
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 10 deletions.
Binary file added docs/assets/advanced-flow-basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/advanced-flow-local-labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/advanced-flow-with-cleaning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 26 additions & 2 deletions docs/flow-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,32 @@ In the "and" column you need to make sure that you only get the notification whe
![flow-and](assets/flow-and.jpg)

### Then
In the then we want to send a push notification to a mobile phone with a text, or we want to do a spoken message. We can do this with the Global Tag that the app provides (and that can be configured in [Settings](settings.md)). Because we want the text for trash that is collected "Today" we need to select the "Collected Today" global tag.
In the then we want to send a push notification to a mobile phone with a text. We can do this with the Global Tag that the app provides (and that can be configured in [Settings](settings.md)). Because we want the text for trash that is collected "Today" we need to select the "Collected Today" global tag.
![flow-then](assets/flow-then.jpg)

### Changing the basic flow
Let's say you want to receive a notification the day before. Then we have to change the basic flow a bit. The trigger has to be (probably) somewhere in the afternoon. The condition, has to be switched from "Today" to "Tomorrow", since we want to know if a trash can is collected tomorrow. In the Then column we have to use the global tab "Collected Tomorrow", because this contains the information of which type of trash is collected tomorrow.
Let's say you want to receive a notification the day before. Then we have to change the basic flow a bit. The trigger has to be (probably) somewhere in the afternoon. The condition, has to be switched from "Today" to "Tomorrow", since we want to know if the trash is collected tomorrow. In the Then column we have to use the global tab "Collected Tomorrow", because this contains the information of which type of trash is collected tomorrow.

## Advanced Flows
### Trash Collection Notification - Use of global tags
The easiest way to set-up a reminder is by using the global tags. There are three global tags available, for today, tomorrow and the day after tomorrow.
With this you can notify yourself one or two days before a certain container is collected, or on the day itself.

In the screenshot below you see an example flow that reminds you at 8 in the morning to push the trash out when it is collected on that day.
If you want to influence the output message, you can do so via the [Settings](settings.md) screen in the app.

For this flow, you use the card in the "And" column.
![advanced-flow-basic](assets/advanced-flow-basic.png)

### Trash Collection Notification - Use of advanced cards
Another way to set-up a reminder is by using local tags. For this to work you need the card in the "Then" column.
You will get three available tags: Collection day (yes, no), Short Trash Type, Trash Type Label.
The Collection Day will be Yes if ANY trash is collected on that day (you can specify if you want to know it for today, tomorrow or day after tomorrow).
The Short Trash Type, will give you the short trash name.
The Trash Type Label, will give you the trash name as specified in the [Settings](settings.md) screen of the app.
![advanced-flow-local-labels](assets/advanced-flow-local-labels.png)

### Trash & Cleaning Notifications
To have a simple notification on whether the container is collected and cleaned you can see the example below.
It will make use of a combination of cards and local tags available from those cards.
![advanced-flow-with-cleaning](assets/advanced-flow-with-cleaning.png)
9 changes: 4 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Homey will remind you to put the trash out! You can do this by providing a posta
*NOTE* NO this app will NOT work on Homey Cloud. I'm not investing [100 euro's](https://homey.app/nl-nl/store/product/homey_developer_athom_12m/) a year and my free time on this.

Here you can find information regarding:
- [Settings](settings.md)
- [Configuring the app](settings.md)
- [Flow Examples](flow-examples.md)
- [Developer Guidelines](developer-guidelines.md)

Expand Down Expand Up @@ -56,15 +56,14 @@ A lot of cities are supported with this trashcan reminder. If your city is not s
## Supported Cards
There is one card that you can place in the "and" column. The card lets you check whether or not trash is collected either today, tomorrow or the day after tomorrow. The type of trash that is checked for can be set to a specific one, or to 'any' to include all types.

## Supported Speech / Chat
The speech is removed in this new version. Homey is removing the speech completely from their own product.

## Tags
There are three global tags available. The tags can be configured trough the settings page. The tags represent the trash that is collected today, tomorrow and the day after tomorrow.
There are four global tags available. The text in the tags can be configured trough the settings page. The tags represent the trash that is collected today, tomorrow and the day after tomorrow.
If you want to create a flow that notifies you what type of trash is collected today, use the "today" tag.
If you want to create a flow that notifies you what type of trash is collected tomorrow, use the "tomorrow" tag.
If you want to create a flow that notifies you what type of trash is collected the day after tomorrow, use the "day after tomorrow" tag.
Plase note that the tags are independent from the "What type of trash is collected on << day >>" card available in the "and" column.

The fourth tag has the result of all trash collection dates in JSON format available. If you like custom coding and need some additional flexibility, you can use this global tag.

## Widgets
There is one widget available that displays the trash that is collected next. You can configure the height and amount of items to display through the widget configuration.
11 changes: 9 additions & 2 deletions docs/settings.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# How to configure Trashcan Reminder 2.0
Trashcan Reminder 2.0 has several configuration settings which can be found under "Settings" in your Homey app. On this page you can configure your postal code and house number to see if your address is supported by one of the API's. You can also enter data based on "frequency" or even fully manual. One of the other settings you can configure is the text that is displayed in the "Global Tags". At last there is also some debug information.
Trashcan Reminder 2.0 has several configuration settings which can be found under "Settings" in your Homey app. On this page you can configure your postal code and house number to see if your address is supported by one of the API's. You can also enter data based on "frequency" or even fully manual. Next to that you can configure the text, color and icons of the widget and also configure a custom text to output in the global tags. This wide range of configuration gives you the flexibility to use the app to your liking.

## Working with API
When you first set-up your app you can enter your postal code and house number here in the fields. Then select "Save changes" and the app will search all known API's to find if one gives a valid response. When this is found, you wel get a green text and the dropdown box will show you which API has been chosen. In the debug information at the bottom of the screen (when you scroll down) you can find which dates are found (after pressing "refresh debug information").

If you don't want to get notifications for a certain trash type (for instance, when your trash provider does collect this type of trash, but you don't have that certain container yourself). Then you can easily disable that type by setting the "N/A" (not applicable) for that trash type under the "Date Settings". This way the information of that trash type will be ignored in the flow and in your widget.

## Working with schedule/manual input
When there is no API found based on your postal code and house number you can either try to search for the API and add it in the code yourself. Or you can figure out the schedule behind your trash pickups. Most of the time there is some kind of logic in the collection of the trash.

Expand All @@ -30,12 +32,17 @@ When you change the dropdown field after "Type Collected" to: today/tomorrow/day

This way you are in full control of the text that is displayed in the global tags. This is especially usefull for plastics/PMD collection as this is very region/city specific and isn't always mentioned and categorized in the correct way.

You can see some [optimal flow examples here](flow-examples.md).

## Configure Widget Settings
These settings allow you to configure the individual look and feel per trash type. You can influence the color, icon and text that is displayed in the widget. If you made changes and you don't like them, you can use the &#x21BA; button to reset the details back to the default for that specific trash type.

## Advanced Data Entry
Here you can enter custom dates for trashcan pick-up in JSON format. These dates will be *added* to the existing dates that already exist based on other selected options. This is only for advanced users and isn't recommended to use.

```
{
GFT: ['2022-05-05','2022-05-19'],
GFT: ['2022-05-05T00:00:00Z','2022-05-19T00:00:00Z'],
REST: [],
PAPIER: [],
GROF: [],
Expand Down
5 changes: 4 additions & 1 deletion widgets/trash-reminder-list/public/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ class WidgetScript {
// Select right display thing based on widget setting
const trashIcon = this.settings.displayRule != 'settings' ? trashItem.icon || trashItem.settingIcon : trashItem.settingIcon;
const trashTypeText = this.settings.displayRule === 'trashprovider' ? trashItem.localText || trashItem.settingText : trashItem.settingText;
const trashColor = this.settings.displayRule === 'settings-iconscolors' || this.settings.displayRule === 'trashprovider' ? `style="color: ${trashItem.color || trashItem.settingColor}"` : '';
const trashColor =
this.settings.displayRule === 'settings-iconscolors' || this.settings.displayRule === 'trashprovider'
? `style="color: ${trashItem.color || trashItem.settingColor}"`
: `style="color: ${trashItem.settingColor}"`;

if (this.settings.layoutType === 'large') {
tbody.innerHTML += `
Expand Down

0 comments on commit e7fd4b7

Please sign in to comment.