-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsensors.yaml
964 lines (910 loc) · 39 KB
/
sensors.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
- platform: rest
resource_template: >-
https://data.fingrid.fi/api/datasets/245/data?format=xml&pageSize=1000&startTime={{(utcnow() - timedelta(hours = -1)).strftime('%Y-%m-%dT%H:00:00Z')}}&endTime={{ (utcnow() - timedelta(days = -1)).strftime('%Y-%m-%dT%H:00:00Z')}}
name: Wind power estimate
icon: mdi:wind-power
value_template: 'OK'
headers:
x-api-key: !secret fingrid_api_key
json_attributes:
- "events"
scan_interval: 3600
- platform: rest
resource_template: >-
https://data.fingrid.fi/api/datasets/245/data?format=xml&pageSize=1000&startTime={{ (utcnow() - timedelta(hours=0)).strftime('%Y-%m-%dT00:00:00Z') }}&endTime={{ (utcnow()).strftime('%Y-%m-%dT%H:%M:%SZ') }}
name: Wind power today
icon: mdi:wind-turbine
value_template: 'OK'
headers:
x-api-key: !secret fingrid_api_key
json_attributes:
- "events"
scan_interval: 3600
- platform: template
sensors:
energy_spot_price:
friendly_name: "Nordpool Spot Price"
unit_of_measurement: 'c/kWh'
value_template: "{{ ('sensor.nordpool_kwh_fi_eur_3_10_0255') }}"
energy_helen:
friendly_name: "Helen Spot Price €/kWh"
unit_of_measurement: '€/kWh'
value_template: "{{ (states('sensor.nordpool_kwh_fi_eur_3_10_0255') | float / 100 ) | round(4) + 0.0034 }}"
energy_helen_alv10c:
friendly_name: "Helen Spot Price c/kWh alv. 24%"
unit_of_measurement: 'c/kWh'
value_template: "{{ (states('sensor.nordpool_kwh_fi_eur_3_10_0255') | float + 0.34 ) }}"
energy_spot_average_price:
friendly_name: "Nordpool Average Spot Price"
unit_of_measurement: 'c/kWh'
#value_template: "{{ (state_attr('sensor.nordpool_kwh_fi_eur_3_10_0255', 'average') | float | round(2)) }}"
value_template: "{{ state_attr('sensor.nordpool_kwh_fi_eur_3_10_0255', 'average') | float | round(2) }}"
#value_template: "{{ state_attr('sensor.nordpool_kwh_fi_eur_3_10_0255', 'average') | int(0) }}"
cheapest_hours_energy_tomorrow:
device_class: timestamp
friendly_name: Cheapest sequential electricity hours
value_template: >
{%- set numberOfSequentialHours = 3 -%}
{%- set lastHour = 23 -%}
{%- set firstHour = 0 -%}
{%- if state_attr('sensor.nordpool_kwh_fi_eur_3_10_0255', 'tomorrow_valid') == true -%}
{%- set ns = namespace(counter=0, list=[], cheapestHour=today_at("00:00") + timedelta( hours = (24)), cheapestPrice=999.00) -%}
{%- for i in range(firstHour + numberOfSequentialHours, lastHour+1) -%}
{%- set ns.counter = 0.0 -%}
{%- for j in range(i-numberOfSequentialHours, i) -%}
{%- set ns.counter = ns.counter + state_attr('sensor.nordpool_kwh_fi_eur_3_10_0255', 'tomorrow')[j] -%}
{%- endfor -%}
{%- set ns.list = ns.list + [ns.counter] -%}
{%- if ns.counter < ns.cheapestPrice -%}
{%- set ns.cheapestPrice = ns.counter -%}
{%- set ns.cheapestHour = today_at("00:00") + timedelta( hours = (24 + i - numberOfSequentialHours)) -%}
{%- endif -%}
{%- endfor -%}
{{ ns.cheapestHour }}
{%- set ns.cheapestPrice = ns.cheapestPrice / numberOfSequentialHours -%}
{%- endif -%}
nordpool:
friendly_name: "Nordpool"
unit_of_measurement: 'c/kWh'
value_template: "{{ states('sensor.nordpool_kwh_fi_eur_3_10_0255') }}"
availability_template: "{{ states('sensor.nordpool_kwh_fi_eur_3_10_0255') not in ['unknown', 'unavailable'] }}"
attribute_templates:
raw_today: "{{ state_attr('sensor.nordpool_kwh_fi_eur_3_10_0255', 'raw_today') }}"
raw_tomorrow: "{{ state_attr('sensor.nordpool_kwh_fi_eur_3_10_0255', 'raw_tomorrow') }}"
- platform: rest
resource: http://ip.jsontest.com
name: External IP
value_template: '{{ value_json.ip }}'
# BTC Price USD
- platform: cryptoinfo_advanced
id: "BTC Price"
cryptocurrency_name: "bitcoin"
currency_name: "usd"
unit_of_measurement: "$"
update_frequency: 0.5
extra_sensors:
- property: "all_time_high"
unit_of_measurement: "$"
- property: "all_time_high_distance"
unit_of_measurement: "$"
# BTC Price GBP
- platform: cryptoinfo_advanced
id: "BTC Price EUR"
cryptocurrency_name: "bitcoin"
currency_name: "eur"
unit_of_measurement: "€"
update_frequency: 0.5
# BTC Dom
- platform: cryptoinfo_advanced
id: "BTC Dominance"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
- platform: cryptoinfo
id: "main wallet"
cryptocurrency_name: "ethereum"
currency_name: "eur"
unit_of_measurement: "€"
multiplier: 1.05
update_frequency: 1
- platform: template
sensors:
cryptoinfo_main_wallet_ethereum_eur_24h_volume:
value_template: "{{ state_attr('sensor.cryptoinfo_main_wallet_ethereum_eur', 'volume') | round(0) }}"
unit_of_measurement: "€"
- platform: template
sensors:
crypto_bitcoin_owned:
friendly_name: "Bitcoin Owned"
unit_of_measurement: '$'
value_template: >-
{% if not is_state('sensor.cryptoinfo_bitcoin_usd', 'unknown') %}
{{ (states('sensor.cryptoinfo_bitcoin_usd')|float *0.12345) | round(2) }}
{%endif %}
- platform: cryptoinfo
id: "dougecoin wallet"
cryptocurrency_name: "douge"
currency_name: "eur"
unit_of_measurement: "€"
multiplier: 1.5
update_frequency: 1
# BTC Price USD
- platform: cryptoinfo_advanced
id: "BTC Price"
cryptocurrency_name: "bitcoin"
currency_name: "usd"
unit_of_measurement: "$"
update_frequency: 0.5
extra_sensors:
- property: "all_time_high"
unit_of_measurement: "$"
- property: "all_time_high_distance"
unit_of_measurement: "$"
# BTC Price GBP
- platform: cryptoinfo_advanced
id: "BTC Price GBP"
cryptocurrency_name: "bitcoin"
currency_name: "gbp"
unit_of_measurement: "£"
update_frequency: 0.5
# BTC Dom
- platform: cryptoinfo_advanced
id: "BTC Dominance"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 0.5
api_mode: "dominance"
# ETH Dom
- platform: cryptoinfo_advanced
id: "ETH Dominance"
cryptocurrency_name: "eth"
unit_of_measurement: "%"
update_frequency: 0.5
api_mode: "dominance"
# BTC Chain Summary
- platform: cryptoinfo_advanced
id: "BTC Height"
cryptocurrency_name: "btc"
unit_of_measurement: "Blks"
update_frequency: 2
api_mode: "chain_summary"
extra_sensors:
- property: hashrate_calc
id: "BTC Hashrate EH"
unit_of_measurement: EH
- property: difficulty_block_progress
id: "BTC Difficulty Block Progress"
unit_of_measurement: "Blks"
state_class: total_increasing
- property: difficulty_retarget_height
id: "BTC Difficulty Retarget Height"
unit_of_measurement: "Blks"
- property: block_time_in_seconds
id: "BTC Block Time In Seconds"
unit_of_measurement: "seconds"
- property: difficulty_retarget_seconds
id: "BTC Difficulty Retarget Seconds"
unit_of_measurement: "seconds"
- property: difficulty_retarget_percent_change
id: "BTC Difficulty Retarget Percent Change"
unit_of_measurement: "%"
- property: difficulty_retarget_estimated_diff
id: "BTC Difficulty Retarget Estimated Diff"
unit_of_measurement: ""
- property: halving_block_progress
id: "BTC Halving Block Progress"
unit_of_measurement: "Blks"
- property: next_halving_height
id: "BTC Next Halving Height"
unit_of_measurement: "Blks"
- property: total_halvings_to_date
id: "BTC Total Halvings To Date"
unit_of_measurement: "Halvings"
# BTC Hash Control
- platform: cryptoinfo_advanced
id: "BTC Foundry USA Hash Control 100 Blocks"
unique_id: "btc_cco_bc1qxh"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "FoundryUSA"
- "bc1qxh"
- platform: cryptoinfo_advanced
id: "BTC F2Pool Hash Control 100 Blocks"
unique_id: "btc_cco_1KFHE7"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "F2Pool"
- "1KFHE7"
- platform: cryptoinfo_advanced
id: "BTC Binance Hash Control 100 Blocks"
unique_id: "btc_cco_1Q8QR5"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "Binance"
- "1Q8QR5"
- "3L8Ck6"
- platform: cryptoinfo_advanced
id: "BTC AntPool Hash Control 100 Blocks"
unique_id: "btc_cco_AntPool38XnPv"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "AntPool"
- "38XnPv"
- platform: cryptoinfo_advanced
id: "BTC ViaBTC Hash Control 100 Blocks"
unique_id: "btc_cco_ViaBTC"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "ViaBTC"
- "18cBEM"
- platform: cryptoinfo_advanced
id: "BTC BTC.Com Hash Control 100 Blocks"
unique_id: "btc_cco_36cWgj"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "BTC.Com"
- "36cWgj"
- platform: cryptoinfo_advanced
id: "BTC MaraPool Hash Control 100 Blocks"
unique_id: "btc_cco_15MdAH"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "MaraPool"
- "15MdAH"
- platform: cryptoinfo_advanced
id: "BTC Poolin Hash Control 100 Blocks"
unique_id: "btc_cco_poolin"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "Poolin"
- "33TbzA"
- platform: cryptoinfo_advanced
id: "BTC Pegapool Hash Control 100 Blocks"
unique_id: "btc_cco_pegapool"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "3GRKUV"
- platform: cryptoinfo_advanced
id: "BTC Luxor Hash Control 100 Blocks"
unique_id: "btc_cco_luxor"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "39bitU"
- platform: cryptoinfo_advanced
id: "BTC EMCD.io Hash Control 100 Blocks"
unique_id: "btc_cco_emcdio"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "3LwoXD"
- platform: cryptoinfo_advanced
id: "BTC Slushpool Hash Control 100 Blocks"
unique_id: "btc_cco_slush"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "1CK6KH"
- platform: cryptoinfo_advanced
id: "BTC CarbonNegative Hash Control 100 Blocks"
unique_id: "btc_cco_carbonnegative"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "3KZDwm"
- platform: cryptoinfo_advanced
id: "BTC SBICrypto Hash Control 100 Blocks"
unique_id: "btc_cco_sbicrypto"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "bc1qte"
- platform: cryptoinfo_advanced
id: "BTC Ultimus Hash Control 100 Blocks"
unique_id: "btc_cco_ultimus"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "3C9sAK"
- platform: cryptoinfo_advanced
id: "BTC Terrapool Hash Control 100 Blocks"
unique_id: "btc_cco_terrapool"
cryptocurrency_name: "btc"
unit_of_measurement: "%"
update_frequency: 1
api_mode: "chain_control"
pool_prefix:
- "bc1q39"
# BTC Last Diff
- platform: cryptoinfo_advanced
id: "BTC Last Diff Timestamp"
cryptocurrency_name: "btc"
unit_of_measurement: "s"
update_frequency: 1
api_mode: "chain_block_time"
# BTC Orphans
- platform: cryptoinfo_advanced
id: "BTC Orphans Today"
cryptocurrency_name: "btc"
unit_of_measurement: "Blks"
update_frequency: 1
api_mode: "chain_orphans"
# BTC Mempool
- platform: cryptoinfo_advanced
id: "BTC Mempool Size"
cryptocurrency_name: "btc"
unit_of_measurement: "vB"
update_frequency: 1
api_mode: "mempool_stats"
extra_sensors:
- property: mempool_tx_count
id: "BTC Mempool TX Count"
unit_of_measurement: "tx"
- property: mempool_total_fee
id: "BTC Mempool Total Fees"
unit_of_measurement: "satoshis"
- property: mempool_size_calc
id: "BTC Mempool Size MB"
unit_of_measurement: "MB"
- platform: rest
name: Dogecoin Price
resource: https://api.coingecko.com/api/v3/simple/price?ids=dogecoin&vs_currencies=usd
value_template: "{{ value_json.dogecoin.usd | float | round(3) }}"
unit_of_measurement: 'USD'
scan_interval: 3600 # Update every hour
- platform: rest
name: Litecoin Price
resource: https://api.coingecko.com/api/v3/simple/price?ids=litecoin&vs_currencies=usd
value_template: "{{ value_json.litecoin.usd | float | round(3) }}"
unit_of_measurement: 'USD'
scan_interval: 3600 # Update every hour
- platform: rest
name: Dogecoin Price USD
resource: https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=74&convert=USD
headers:
X-CMC_PRO_API_KEY: !secret coinmarketcap_api_key
value_template: "{{ value_json.data['74'].quote.USD.price | float | round(3) }}"
unit_of_measurement: 'USD'
scan_interval: 3600 # Update every hour
- platform: rest
name: Litecoin Price USD
resource: https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=2&convert=USD
headers:
X-CMC_PRO_API_KEY: !secret coinmarketcap_api_key
value_template: "{{ value_json.data['2'].quote.USD.price | float | round(3) }}"
unit_of_measurement: 'USD'
scan_interval: 3600 # Update every hour
- platform: rest
name: Dogecoin Price EUR
resource: https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=74&convert=EUR
headers:
X-CMC_PRO_API_KEY: !secret coinmarketcap_api_key
value_template: "{{ value_json.data['74'].quote.EUR.price | float | round(3) }}"
unit_of_measurement: 'EUR'
scan_interval: 3600 # Update every hour
- platform: rest
name: Litecoin Price EUR
resource: https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?id=2&convert=EUR
headers:
X-CMC_PRO_API_KEY: !secret coinmarketcap_api_key
value_template: "{{ value_json.data['2'].quote.EUR.price | float | round(3) }}"
unit_of_measurement: 'EUR'
scan_interval: 3600 # Update every hour
- platform: template
sensors:
eur_in_doge:
friendly_name: "EUR in DOGE"
value_template: "{{ (1 / states('sensor.dogecoin_price_eur') | float) | round(7) }}"
unit_of_measurement: 'DOGE'
eur_in_ltc:
friendly_name: "EUR in LTC"
value_template: "{{ (1 / states('sensor.litecoin_price_eur') | float) | round(7) }}"
unit_of_measurement: 'LTC'
# Binance LTC Price in USD
#- platform: rest
# name: Binance LTC Price in USD
# resource: https://api.binance.com/api/v3/ticker/price?symbol=LTCUSDT
# value_template: "{{ value_json['price'] | float }}"
# unit_of_measurement: 'USD'
# scan_interval: 3600
# Binance LTC Balance
#- platform: command_line
# name: Binance LTC Balance
# command: "/usr/local/bin/python3 /config/python_scripts/get_binance_balance.py > /config/command_output.log 2>&1"
# unit_of_measurement: 'LTC'
# scan_interval: 3600
#- platform: mqtt
# name: "Binance LTC Balance"
# state_topic: "binance/ltc_balance"
# unit_of_measurement: "LTC"
- platform: template
sensors:
balance_total_eur:
value_template: >
{% if states('sensor.exodus_balance_total_eur') not in ['unknown', 'unavailable'] and
states('sensor.kraken_balance_total_eur') not in ['unknown', 'unavailable'] and
states('sensor.binance_balance_total_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.exodus_balance_total_eur') | float +
states('sensor.kraken_balance_total_eur') | float +
states('sensor.binance_balance_total_eur') | float) | round(2) }}
{% else %}
{{ states('sensor.balance_total_eur') }}
{% endif %}
unit_of_measurement: "EUR"
balance_total_usd:
value_template: >
{% if states('sensor.exodus_balance_total_usd') not in ['unknown', 'unavailable'] and
states('sensor.kraken_balance_total_usd') not in ['unknown', 'unavailable'] and
states('sensor.binance_balance_total_usd') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.exodus_balance_total_usd') | float +
states('sensor.kraken_balance_total_usd') | float +
states('sensor.binance_balance_total_usd') | float) | round(2) }}
{% else %}
{{ states('sensor.balance_total_usd') }}
{% endif %}
unit_of_measurement: "USD"
balance_total_cad:
value_template: >
{% if states('sensor.exodus_balance_total_cad') not in ['unknown', 'unavailable'] and
states('sensor.kraken_balance_total_cad') not in ['unknown', 'unavailable'] and
states('sensor.binance_balance_total_cad') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.exodus_balance_total_cad') | float +
states('sensor.kraken_balance_total_cad') | float +
states('sensor.binance_balance_total_cad') | float) | round(2) }}
{% else %}
{{ states('sensor.balance_total_cad') }}
{% endif %}
unit_of_measurement: "CAD"
balance_total_ltc:
value_template: >
{% if states('sensor.exodus_balance_ltc') not in ['unknown', 'unavailable'] and
states('sensor.kraken_balance_ltc') not in ['unknown', 'unavailable'] and
states('sensor.binance_balance_ltc') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.exodus_balance_ltc') | float +
states('sensor.kraken_balance_ltc') | float +
states('sensor.binance_balance_ltc') | float) | round(8) }}
{% else %}
{{ states('sensor.balance_total_ltc') }}
{% endif %}
unit_of_measurement: "LTC"
balance_total_doge:
value_template: >
{% if states('sensor.exodus_balance_doge') not in ['unknown', 'unavailable'] and
states('sensor.kraken_balance_doge') not in ['unknown', 'unavailable'] and
states('sensor.binance_balance_doge') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.exodus_balance_doge') | float +
states('sensor.kraken_balance_doge') | float +
states('sensor.binance_balance_doge') | float) | round(8) }}
{% else %}
{{ states('sensor.balance_total_doge') }}
{% endif %}
unit_of_measurement: "DOGE"
balance_total_btc:
value_template: >
{% if states('sensor.exodus_balance_btc') not in ['unknown', 'unavailable'] and
states('sensor.kraken_balance_btc') not in ['unknown', 'unavailable'] and
states('sensor.binance_balance_btc') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.exodus_balance_btc') | float +
states('sensor.kraken_balance_btc') | float +
states('sensor.binance_balance_btc') | float) | round(8) }}
{% else %}
{{ states('sensor.balance_total_btc') }}
{% endif %}
unit_of_measurement: "BTC"
balance_total_xrp:
value_template: >
{{ (states('sensor.binance_balance_xrp')) | float(0) | round(8) }}
unit_of_measurement: "XRP"
balance_total_pepe:
value_template: >
{% if states('sensor.binance_balance_pepe') not in ['unknown', 'unavailable'] %}
{{ states('sensor.binance_balance_pepe') | float }}
{% else %}
{{ states('sensor.balance_total_pepe') }}
{% endif %}
unit_of_measurement: "PEPE"
balance_total_bnb:
value_template: >
{% if states('sensor.binance_balance_bnb') not in ['unknown', 'unavailable'] %}
{{ states('sensor.binance_balance_bnb') | float | round(8) }}
{% else %}
{{ states('sensor.balance_total_bnb') }}
{% endif %}
unit_of_measurement: "BNB"
balance_total_eth:
value_template: >
{% if states('sensor.binance_balance_eth') not in ['unknown', 'unavailable'] %}
{{ states('sensor.binance_balance_eth') | float | round(8) }}
{% else %}
{{ states('sensor.balance_total_eth') }}
{% endif %}
unit_of_measurement: "ETH"
balance_total_ada:
value_template: >
{% if states('sensor.binance_balance_ada') not in ['unknown', 'unavailable'] %}
{{ states('sensor.binance_balance_ada') | float | round(8) }}
{% else %}
{{ states('sensor.balance_total_ada') }}
{% endif %}
unit_of_measurement: "ADA"
ltc_balance_in_eur:
friendly_name: "LTC Balance (EUR)"
unit_of_measurement: '€'
value_template: >-
{% if states('sensor.balance_total_ltc') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_ltc') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.balance_total_ltc') | float *
states('sensor.crypto_coin_value_ltc') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
- platform: template
sensors:
pepe_balance_in_eur:
friendly_name: "PEPE Balance (EUR)"
unit_of_measurement: '€'
value_template: >-
{% if states('sensor.balance_total_pepe') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_pepe') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.balance_total_pepe') | float *
states('sensor.crypto_coin_value_pepe') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
xrp_balance_in_eur:
friendly_name: "XRP Balance (EUR)"
unit_of_measurement: '€'
value_template: >-
{% if states('sensor.balance_total_xrp') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_xrp') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.balance_total_xrp') | float *
states('sensor.crypto_coin_value_xrp') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
btc_balance_in_eur:
friendly_name: "BTC Balance (EUR)"
unit_of_measurement: '€'
value_template: >-
{% if states('sensor.balance_total_btc') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_btc') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.balance_total_btc') | float *
states('sensor.crypto_coin_value_btc') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
doge_balance_in_eur:
friendly_name: "DOGE Balance (EUR)"
unit_of_measurement: '€'
value_template: >-
{% if states('sensor.balance_total_doge') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_doge') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.balance_total_doge') | float *
states('sensor.crypto_coin_value_doge') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
bnb_balance_in_eur:
friendly_name: "BNB Balance (EUR)"
unit_of_measurement: '€'
value_template: >-
{% if states('sensor.balance_total_bnb') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_bnb') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.balance_total_bnb') | float *
states('sensor.crypto_coin_value_bnb') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
eth_balance_in_eur:
friendly_name: "ETH Balance (EUR)"
unit_of_measurement: '€'
value_template: >-
{% if states('sensor.balance_total_eth') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_eth') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.balance_total_eth') | float *
states('sensor.crypto_coin_value_eth') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
ada_balance_in_eur:
friendly_name: "ADA Balance (EUR)"
unit_of_measurement: '€'
value_template: >-
{% if states('sensor.balance_total_ada') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_ada') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.balance_total_ada') | float *
states('sensor.crypto_coin_value_ada') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
- platform: template
sensors:
binance_btc_2nd_balance_in_eur:
friendly_name: "Binance BTC 2nd Balance in EUR"
unit_of_measurement: "€"
value_template: >-
{% if states('sensor.binance_btc_2nd_balance') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_btc') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.binance_btc_2nd_balance') | float *
states('sensor.crypto_coin_value_btc') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
binance_doge_2nd_balance_in_eur:
friendly_name: "Binance DOGE 2nd Balance in EUR"
unit_of_measurement: "€"
value_template: >-
{% if states('sensor.binance_doge_2nd_balance') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_doge') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.binance_doge_2nd_balance') | float *
states('sensor.crypto_coin_value_doge') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
binance_ltc_2nd_balance_in_eur:
friendly_name: "Binance LTC 2nd Balance in EUR"
unit_of_measurement: "€"
value_template: >-
{% if states('sensor.binance_ltc_2nd_balance') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_ltc') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.binance_ltc_2nd_balance') | float *
states('sensor.crypto_coin_value_ltc') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
binance_bnb_2nd_balance_in_eur:
friendly_name: "Binance BNB 2nd Balance in EUR"
unit_of_measurement: "€"
value_template: >-
{% if states('sensor.binance_bnb_2nd_balance') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_bnb') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.binance_bnb_2nd_balance') | float *
states('sensor.crypto_coin_value_bnb') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
binance_eth_2nd_balance_in_eur:
friendly_name: "Binance ETH 2nd Balance in EUR"
unit_of_measurement: "€"
value_template: >-
{% if states('sensor.binance_eth_2nd_balance') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_eth') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.binance_eth_2nd_balance') | float *
states('sensor.crypto_coin_value_eth') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
binance_ada_2nd_balance_in_eur:
friendly_name: "Binance ADA 2nd Balance in EUR"
unit_of_measurement: "€"
value_template: >-
{% if states('sensor.binance_ada_2nd_balance') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_ada') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{{ (states('sensor.binance_ada_2nd_balance') | float *
states('sensor.crypto_coin_value_ada') | float *
states('sensor.usd_eur') | float) | round(2) }}
{% endif %}
binance_total_2nd_balance_in_eur:
friendly_name: "Binance Total 2nd Balance in EUR"
unit_of_measurement: "€"
value_template: >-
{% if states('sensor.binance2_balance_btc') not in ['unknown', 'unavailable']
and states('sensor.binance2_balance_doge') not in ['unknown', 'unavailable']
and states('sensor.binance2_balance_ltc') not in ['unknown', 'unavailable']
and states('sensor.binance2_balance_bnb') not in ['unknown', 'unavailable']
and states('sensor.binance2_balance_eth') not in ['unknown', 'unavailable']
and states('sensor.binance2_balance_ada') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_btc') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_doge') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_ltc') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_bnb') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_eth') not in ['unknown', 'unavailable']
and states('sensor.crypto_coin_value_ada') not in ['unknown', 'unavailable']
and states('sensor.usd_eur') not in ['unknown', 'unavailable'] %}
{% set btc = states('sensor.binance2_balance_btc') | float * states('sensor.crypto_coin_value_btc') | float * states('sensor.usd_eur') | float %}
{% set doge = states('sensor.binance2_balance_doge') | float * states('sensor.crypto_coin_value_doge') | float * states('sensor.usd_eur') | float %}
{% set ltc = states('sensor.binance2_balance_ltc') | float * states('sensor.crypto_coin_value_ltc') | float * states('sensor.usd_eur') | float %}
{% set bnb = states('sensor.binance2_balance_bnb') | float * states('sensor.crypto_coin_value_bnb') | float * states('sensor.usd_eur') | float %}
{% set eth = states('sensor.binance2_balance_eth') | float * states('sensor.crypto_coin_value_eth') | float * states('sensor.usd_eur') | float %}
{% set ada = states('sensor.binance2_balance_ada') | float * states('sensor.crypto_coin_value_ada') | float * states('sensor.usd_eur') | float %}
{{ (btc + doge + ltc + bnb + eth + ada) | round(2) }}
{% endif %}
- platform: rest
name: Litecoinpool Hashrate
resource: !secret litecoinpool_api_url
value_template: "{{ value_json.user.hash_rate | float / 1000 }}"
unit_of_measurement: "MH/s"
- platform: rest
name: Litecoinpool LTC Balance
resource: !secret litecoinpool_api_url
value_template: "{{ value_json.user.unpaid_rewards | float }}"
unit_of_measurement: "LTC"
- platform: rest
name: Litecoinpool DOGE Balance
resource: !secret litecoinpool_api_url
value_template: "{{ value_json.user.unpaid_rewards_doge | float }}"
unit_of_measurement: "DOGE"
- platform: template
sensors:
electricity_cost_per_kwh:
friendly_name: "Electricity Cost Per kWh"
unit_of_measurement: "€/kWh"
value_template: >
{% set spot_price = (states('sensor.nordpool_kwh_fi_eur_3_10_0255') | float(0)) / 100 %}
{% set electricity_tax = 0.0283 %}
{% set transfer_day = 0.0262 %}
{% set transfer_night = 0.0137 %}
{% set now = now() %}
{% set transfer_cost = transfer_night if now.hour >= 22 or now.hour < 7 else transfer_day %}
{{ (spot_price + electricity_tax + transfer_cost) | round(4) }}
electricity_cost_in_cents_per_kwh:
friendly_name: "Electricity Cost in Cents Per kWh"
unit_of_measurement: "c/kWh"
value_template: >
{% set spot_price = (states('sensor.nordpool_kwh_fi_eur_3_10_0255') | float(0)) %}
{% set electricity_tax = 2.83 %}
{% set transfer_day = 2.62 %}
{% set transfer_night = 1.37 %}
{% set now = now() %}
{% set transfer_cost = transfer_night if now.hour >= 22 or now.hour < 7 else transfer_day %}
{{ (spot_price + electricity_tax + transfer_cost) | round(4) }}
- platform: rest
name: Litecoinpool Market Data
resource: !secret litecoinpool_api_url
method: GET
scan_interval: 300
value_template: "OK"
json_attributes:
- user
- market
- platform: template
sensors:
litecoin_rewards_eur:
friendly_name: "Litecoin Rewards EUR"
unit_of_measurement: "€"
value_template: >
{% set ltc_balance = states('sensor.litecoinpool_ltc_balance') | float(0) %}
{% set ltc_price_eur = state_attr('sensor.litecoinpool_market_data', 'ltc_eur') | float(0) %}
{{ (ltc_balance * ltc_price_eur) | round(2) }}
dogecoin_rewards_eur:
friendly_name: "Dogecoin Rewards EUR"
unit_of_measurement: "€"
value_template: >
{% set doge_balance = states('sensor.litecoinpool_doge_balance') | float(0) %}
{% set doge_price_eur = state_attr('sensor.litecoinpool_market_data', 'doge_eur') | float(0) %}
{{ (doge_balance * doge_price_eur) | round(2) }}
total_rewards_eur:
friendly_name: "Total Rewards EUR"
unit_of_measurement: "€"
value_template: >
{% set total_rewards_ltc = state_attr('sensor.litecoinpool_market_data', 'user')['total_rewards'] | float(0) %}
{% set total_rewards_doge = state_attr('sensor.litecoinpool_market_data', 'user')['total_rewards_doge'] | float(0) %}
{% set ltc_price_eur = state_attr('sensor.litecoinpool_market_data', 'market')['ltc_eur'] | float(0) %}
{% set doge_price_eur = state_attr('sensor.litecoinpool_market_data', 'market')['doge_eur'] | float(0) %}
{{ ((total_rewards_ltc * ltc_price_eur) + (total_rewards_doge * doge_price_eur)) | round(2) }}
total_rewards_ltc_eur:
friendly_name: "Total Rewards LTC EUR"
unit_of_measurement: "€"
value_template: >
{% set total_rewards = state_attr('sensor.litecoinpool_market_data', 'user')['total_rewards'] | float(0) %}
{% set ltc_price_eur = state_attr('sensor.litecoinpool_market_data', 'market')['ltc_eur'] | float(0) %}
{{ (total_rewards * ltc_price_eur) | round(4) }}
- platform: template
sensors:
shellyplug_s_3ce90ee04b97_energy_cost_hourly:
friendly_name: "Shelly Plug Hourly Cost"
unit_of_measurement: "€"
value_template: >
{% set power = states('sensor.shellyplug_s_3ce90ee04b97_power') | float(0) %}
{% set cost_per_kwh = states('sensor.electricity_cost_per_kwh') | float(0) %}
{{ ((power / 1000) * cost_per_kwh) | round(2) }}
shellyplug_s_3ce90ee04b97_energy_cost_daily:
friendly_name: "Shelly Plug Daily Cost"
unit_of_measurement: "€"
value_template: >
{% set power = states('sensor.shellyplug_s_3ce90ee04b97_power') | float(0) %}
{% set cost_per_kwh = states('sensor.electricity_cost_per_kwh') | float(0) %}
{{ ((power / 1000) * cost_per_kwh * 24) | round(2) }}
shellyplug_s_3ce90ee04b97_energy_cost_weekly:
friendly_name: "Shelly Plug Weekly Cost"
unit_of_measurement: "€"
value_template: >
{% set power = states('sensor.shellyplug_s_3ce90ee04b97_power') | float(0) %}
{% set cost_per_kwh = states('sensor.electricity_cost_per_kwh') | float(0) %}
{{ ((power / 1000) * cost_per_kwh * 24 * 7) | round(2) }}
- platform: template
sensors:
miner_rewards_hourly:
friendly_name: "Miner Rewards Hourly"
unit_of_measurement: "€"
value_template: >
{% set expected_24h_rewards = state_attr('sensor.litecoinpool_market_data', 'user')['expected_24h_rewards'] | float(0) %}
{% set ltc_price_eur = (state_attr('sensor.litecoinpool_market_data', 'market')['ltc_eur'] | float(0)) * 10 %}
{{ ((expected_24h_rewards * ltc_price_eur) / 24) | round(4) }}
miner_rewards_daily:
friendly_name: "Miner Rewards Daily"
unit_of_measurement: "€"
value_template: >
{% set expected_24h_rewards = state_attr('sensor.litecoinpool_market_data', 'user')['expected_24h_rewards'] | float(0) %}
{% set ltc_price_eur = (state_attr('sensor.litecoinpool_market_data', 'market')['ltc_eur'] | float(0)) * 10 %}
{{ (expected_24h_rewards * ltc_price_eur) | round(4) }}
miner_profitability:
friendly_name: "Miner Profitability"
unit_of_measurement: "€"
value_template: >
{% set daily_rewards = states('sensor.miner_rewards_daily') | float(0) %}
{% set daily_costs = states('sensor.shellyplug_s_3ce90ee04b97_energy_cost_daily') | float(0) %}
{{ (daily_rewards - daily_costs) | round(2) }}
- platform: template
sensors:
accumulated_rewards_eur:
friendly_name: "Accumulated Rewards EUR"
unit_of_measurement: "€"
value_template: >
{% set current_rewards = states('sensor.litecoin_rewards_eur') | float(0) %}
{% set total_rewards = states('sensor.accumulated_rewards_eur') | float(0) %}
{{ (total_rewards + current_rewards) | round(2) }}
- platform: template
sensors:
miner_paid_rewards_eur:
friendly_name: "Miner Paid Rewards EUR"
unit_of_measurement: "€"
value_template: >
{% set paid_rewards_ltc = state_attr('sensor.litecoinpool_market_data', 'user')['paid_rewards'] | float(0) %}
{% set paid_rewards_doge = state_attr('sensor.litecoinpool_market_data', 'user')['paid_rewards_doge'] | float(0) %}
{% set ltc_price_eur = state_attr('sensor.litecoinpool_market_data', 'ltc_eur') | float(0) %}
{% set doge_price_eur = state_attr('sensor.litecoinpool_market_data', 'doge_eur') | float(0) %}
{{ ((paid_rewards_ltc * ltc_price_eur) + (paid_rewards_doge * doge_price_eur)) | round(2) }}
worker_rewards_eur:
friendly_name: "Worker Rewards EUR"
unit_of_measurement: "€"
value_template: >
{% set workers = state_attr('sensor.litecoinpool_market_data', 'workers') %}
{% if workers and 'elsonico.dg1' in workers %}
{% set worker_rewards_ltc = workers['elsonico.dg1'].get('rewards', 0) | float(0) %}
{% set worker_rewards_doge = workers['elsonico.dg1'].get('rewards_doge', 0) | float(0) %}
{% set ltc_price_eur = state_attr('sensor.litecoinpool_market_data', 'ltc_eur') | float(0) %}
{% set doge_price_eur = state_attr('sensor.litecoinpool_market_data', 'doge_eur') | float(0) %}
{{ ((worker_rewards_ltc * ltc_price_eur) + (worker_rewards_doge * doge_price_eur)) | round(2) }}
{% else %}
0.00
{% endif %}