TableTennisDisplay added. Together with new documentation and even more infos.

This commit is contained in:
2022-05-25 10:58:02 +02:00
parent 41b9d2d175
commit 5eb3ab6bc9
3 changed files with 435 additions and 1 deletions

View File

@@ -37,4 +37,32 @@ Topic `tabletenniscounter/control/score/count` will be send with the value of ei
### Undoing last points (Up to 10 points)
Topic `tabletenniscounter/control/score/undo` will be sent with no payload to worry about. The counting part on the respberry pi is supposed to keep a list of the last 10 points.
More infos are added soon!
## Table tennis LED display
### Overall
This is probably the more exciting bit about this. It's the part that actually displays the numbers on the display. The part, that tries to displays all the numbers in a way people can use it to read their current score.
We have a LOT of stuff of stuff to discuss here.
First of all: It does take advantage of custom components. CustomMQTTDevices to be precise.
Second of all: It uses the NeoPixelBus Library to communicate with the ledstrip.
Third of all: It does also use the esphome native api.
And a disclaimer as well: The native api part was the latest thing added and is by no means ready to be used. In fact it is only used right now to publish the current score to home assistent but nothing else as it cannot display the numbers sent to the esphome over the native api. This feature is planned but not yet implemented tho.
For the MQTT part we have only one topic to worry about.
### MQTT JSON message
MQTT topic `tabletenniscounter/display/number/command` is used to send the score that should be display encoded as a JSON message. So let's go over the different key/values attributes.
- state => "ON"/"OFF": This must always be included and must be ON if any other fuctionallity is intended to be used as OFF is going to turn the ledstrip OFF no matter what
- player1 => Number 0 - 99: This tells the display the score of player red (which is also the left number). This MUST be used together with player2 and player1Start/displayGreen.
- player2 => Number 0 - 99: This tells the display the score of player blue (which is also the right number). This MUST be used together with player1 and player1Start/displayGreen.
- player1Start => true/false: This if this is used to display which player is supposed to start. If the value is true, the colon between the two numbers is displayed as red, if it's false, the colon is blue. This attribute can be replaced with displayGreen.
- displayGreen: The value for this does not matter. If it's there, the colon is green.
- player1Winner => true/false (OPTIONAL): Set this to true, and player 1 (red) will be displayed as the winner by displaying the red number as yellow. If it's false, player 2 (blue) will be displayed as the winner. Omit this attribute if no one should be displayed at the winner.
Should state ON be sent without any other attribute, the nbs logo is displayed with a little minus at the end for no particular reason.
More infos are coming soon.