Skip to content

microgrid_pb2_grpc

frequenz.api.microgrid.microgrid_pb2_grpc ¤

Client and server classes corresponding to protobuf-defined services.

Classes¤

frequenz.api.microgrid.microgrid_pb2_grpc.Microgrid ¤

Bases: object

Missing associated documentation comment in .proto file.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
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
class Microgrid(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def GetMicrogridMetadata(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListComponents(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/ListComponents',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListConnections(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/ListConnections',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamComponentData(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/StreamComponentData',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CanStreamData(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/CanStreamData',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AddExclusionBounds(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/AddExclusionBounds',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AddInclusionBounds(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/AddInclusionBounds',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SetPowerActive(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/SetPowerActive',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SetPowerReactive(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/SetPowerReactive',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Start(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/Start',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def HotStandby(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/HotStandby',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ColdStandby(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/ColdStandby',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Stop(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/Stop',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ErrorAck(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/ErrorAck',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

frequenz.api.microgrid.microgrid_pb2_grpc.MicrogridAsyncStub ¤

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
        * Battery: Checks if DC relays are open, then
        * closes DC relays

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.

        If a feature required to perform an action is missing, then that action is
        skipped.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def HotStandby(self, request, context):
        """Sets the given component into a hot-standby state, from which it can return
        into an operational state within at most 5 seconds.

        Performs the following sequence actions for the following component
        categories:

        * Inverter: Checks if AC and DC relays are closed, then
        * sets power to 0

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ColdStandby(self, request, context):
        """Sets the given component into a cold-standby state, from which it can
        return into an operational state within at most 2 minutes.

        Performs the following sequence actions for the following component
        categories:

        * Inverter: Checks if AC and DC relays are closed, then
        * sets power to 0, and
        * opens AC relays

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call efffectively skips that action.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Stop(self, request, context):
        """Stops the component completely, potentially disengaging its power
        electronics controller(s).

        Performs the following sequence actions for the following component
        categories:

        * Inverter:
        * Brings component to the cold-standby state
        * opens DC relays

        * Battery: Checks if the power output is 0, then
        * opens DC relays

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.

        If a feature required to perform an action is missing, then that action is
        skipped.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ErrorAck(self, request, context):
        """Acknowledges any recoverable error reported by the component, and brings it
        back to the stopped or cold-standby state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_MicrogridServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetMicrogridMetadata': grpc.unary_unary_rpc_method_handler(
                    servicer.GetMicrogridMetadata,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.SerializeToString,
            ),
            'ListComponents': grpc.unary_unary_rpc_method_handler(
                    servicer.ListComponents,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.FromString,
                    response_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.SerializeToString,
            ),
            'ListConnections': grpc.unary_unary_rpc_method_handler(
                    servicer.ListConnections,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.FromString,
                    response_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.SerializeToString,
            ),
            'StreamComponentData': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamComponentData,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.SerializeToString,
            ),
            'CanStreamData': grpc.unary_unary_rpc_method_handler(
                    servicer.CanStreamData,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.SerializeToString,
            ),
            'AddExclusionBounds': grpc.unary_unary_rpc_method_handler(
                    servicer.AddExclusionBounds,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.FromString,
                    response_serializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.SerializeToString,
            ),
            'AddInclusionBounds': grpc.unary_unary_rpc_method_handler(
                    servicer.AddInclusionBounds,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.FromString,
                    response_serializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.SerializeToString,
            ),
            'SetPowerActive': grpc.unary_unary_rpc_method_handler(
                    servicer.SetPowerActive,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'SetPowerReactive': grpc.unary_unary_rpc_method_handler(
                    servicer.SetPowerReactive,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Start': grpc.unary_unary_rpc_method_handler(
                    servicer.Start,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'HotStandby': grpc.unary_unary_rpc_method_handler(
                    servicer.HotStandby,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'ColdStandby': grpc.unary_unary_rpc_method_handler(
                    servicer.ColdStandby,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Stop': grpc.unary_unary_rpc_method_handler(
                    servicer.Stop,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'ErrorAck': grpc.unary_unary_rpc_method_handler(
                    servicer.ErrorAck,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'frequenz.api.microgrid.Microgrid', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Microgrid(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def GetMicrogridMetadata(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListComponents(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/ListComponents',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListConnections(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/ListConnections',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamComponentData(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(
            request,
            target,
            '/frequenz.api.microgrid.Microgrid/StreamComponentData',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CanStreamData(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
Attributes¤
AddExclusionBounds: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetBoundsParam, google.protobuf.timestamp_pb2.Timestamp] instance-attribute ¤

Adds exclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given exclusion bounds will stay in effect.

Exclusion bounds refer to the range of values that are disallowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraints value <= lower OR upper <= value.

Exclusion bounds are a useful tool for enhancing the performance of a system. They can be used to restrict the acceptance of commands that fall below a certain threshold, which can help ensure the smooth functioning of the system. E.g., exclusion bounds can be set to limit the minimum charging power to a sufficiently high level, preventing a peak-shaver client from sending charge powers that are too low when a DC heater client is executing a charge pulse. This can significantly improve the overall performance of the DC heating mechanism.

If multiple exclusion bounds have been provided bor a metric, then the aggregated lower and upper exclusion bounds are calculated as follows: lower: the minimum of all lower exclusion bounds upper: the maximum of all upper exclusion bounds

It is important to note that these bounds work together with system_inclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

  inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
               exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

AddInclusionBounds: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetBoundsParam, google.protobuf.timestamp_pb2.Timestamp] instance-attribute ¤

Adds inclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given inclusion bounds will stay in effect.

Inclusion bounds refer to the range of values that are allowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraint lower <= value <= upper.

If multiple inclusion bounds have been provided bor a metric, then the aggregated lower and upper inclusion bounds are calculated as follows: lower: the maximum of all lower inclusion bounds upper: the minimum of all upper inclusion bounds

It is important to note that these bounds work together with system_exclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

  inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
               exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

CanStreamData: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.wrappers_pb2.BoolValue] instance-attribute ¤

Returns whether the component with given ID can stream data.

ColdStandby: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Sets the given component into a cold-standby state, from which it can return into an operational state within at most 2 minutes.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0, and
  • opens AC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call efffectively skips that action.

ErrorAck: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Acknowledges any recoverable error reported by the component, and brings it back to the stopped or cold-standby state.

GetMicrogridMetadata: grpc.aio.UnaryUnaryMultiCallable[google.protobuf.empty_pb2.Empty, frequenz.api.microgrid.microgrid_pb2.MicrogridMetadata] instance-attribute ¤

/ Returns the microgrid metadata / The metadata consists of information that describes the overall / microgrid, as opposed to its components, / e.g., the microgrid ID, location.

HotStandby: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Sets the given component into a hot-standby state, from which it can return into an operational state within at most 5 seconds.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

ListComponents: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentFilter, frequenz.api.microgrid.microgrid_pb2.ComponentList] instance-attribute ¤

List components in the local microgrid, optionally filtered by a given list of component IDs and component categories.

If provided, the filters for component IDs and categories have an AND relationship with one another, meaning that they are applied serially, but the elements within a single filter list have an OR relationship with each other. E.g., if ids = [1, 2, 3], and categories = [ ComponentCategory::COMPONENT_CATEGORY_INVERTER, ComponentCategory::COMPONENT_CATEGORY_BATTERY], then the results will consist of elements that have the IDs 1, OR 2, OR 3, AND are of the categories ComponentCategory::COMPONENT_CATEGORY_INVERTER OR ComponentCategory::COMPONENT_CATEGORY_BATTERY.

If a filter list is empty, then that filter is not applied.

ListConnections: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ConnectionFilter, frequenz.api.microgrid.microgrid_pb2.ConnectionList] instance-attribute ¤

Returns a list of the connections between components as (start, end) pairs of connection IDs, where the direction of individual connections is always away from the grid endpoint, i.e. aligned with the direction of positive current according to the passive sign convention: https://en.wikipedia.org/wiki/Passive_sign_convention

The request may be filtered by start/end component(s) of individual connections. If provided, the start and end filters have an AND relationship between each other, meaning that they are applied serially, but an OR relationship with other elements in the same list. For example, if start = [1, 2, 3], and end = [4, 5, 6], then the result should have all the connections where * each start component ID is either 1, 2, OR 3, AND * each end component ID is either 4, 5, OR 6.

SetPowerActive: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetPowerActiveParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Sets the active power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 W. E.g., an inverter may have a resolution of 88 W. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Performs the following sequence actions for the following component categories:

  • Inverter: Sends the discharge command to the inverter, making it deliver AC power.
SetPowerReactive: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetPowerReactiveParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Sets the reactive power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 VAr. E.g., an inverter may have a resolution of 88 VAr. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Start: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Starts the component, and brings it into a state where it is immediately operational.

Performs the following sequence of actions for the following component categories:

  • Inverter:
  • closes DC relays, if the feature is available
  • closes AC relays
  • sets power output to 0

  • Battery: Checks if DC relays are open, then

  • closes DC relays

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

Stop: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Stops the component completely, potentially disengaging its power electronics controller(s).

Performs the following sequence actions for the following component categories:

  • Inverter:
  • Brings component to the cold-standby state
  • opens DC relays

  • Battery: Checks if the power output is 0, then

  • opens DC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

StreamComponentData: grpc.aio.UnaryStreamMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, frequenz.api.microgrid.microgrid_pb2.ComponentData] instance-attribute ¤

Returns a stream containing data from a component with a given ID.

frequenz.api.microgrid.microgrid_pb2_grpc.MicrogridServicer ¤

Bases: object

Missing associated documentation comment in .proto file.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
class MicrogridServicer(object):
    """Missing associated documentation comment in .proto file."""

    def GetMicrogridMetadata(self, request, context):
        """/ Returns the microgrid metadata
        / The metadata consists of information that describes the overall
        / microgrid, as opposed to its components,
        / e.g., the microgrid ID, location.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListComponents(self, request, context):
        """List components in the local microgrid, optionally filtered by a given list
        of component IDs and component categories.

        If provided, the filters for component IDs and categories have an `AND`
        relationship with one another, meaning that they are applied serially,
        but the elements within a single filter list have an `OR` relationship with
        each other.
        E.g., if `ids` = [1, 2, 3], and `categories` = [
        `ComponentCategory::COMPONENT_CATEGORY_INVERTER`,
        `ComponentCategory::COMPONENT_CATEGORY_BATTERY`],
        then the results will consist of elements that
        have the IDs 1, OR 2, OR 3,
        AND
        are of the categories `ComponentCategory::COMPONENT_CATEGORY_INVERTER` OR
        `ComponentCategory::COMPONENT_CATEGORY_BATTERY`.

        If a filter list is empty, then that filter is not applied.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListConnections(self, request, context):
        """Returns a list of the connections between components as `(start, end)`
        pairs of connection IDs, where the direction of individual connections
        is always away from the grid endpoint, i.e. aligned with the direction
        of positive current according to the passive sign convention:
        https://en.wikipedia.org/wiki/Passive_sign_convention

        The request may be filtered by `start`/`end` component(s) of individual
        connections.  If provided, the `start` and `end` filters have an `AND`
        relationship between each other, meaning that they are applied serially,
        but an `OR` relationship with other elements in the same list.
        For example, if `start` = `[1, 2, 3]`, and `end` = `[4, 5, 6]`, then the
        result should have all the connections where
        * each `start` component ID is either `1`, `2`, OR `3`,
        AND
        * each `end` component ID is either `4`, `5`, OR `6`.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamComponentData(self, request, context):
        """Returns a stream containing data from a component with a given ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CanStreamData(self, request, context):
        """Returns whether the component with given ID can stream data.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddExclusionBounds(self, request, context):
        """Adds exclusion bounds for a given metric of a given component, and returns
        the UTC timestamp until which the given exclusion bounds will stay in
        effect.

        Exclusion bounds refer to the range of values that are disallowed for the
        metric. If these bounds for a metric are [`lower`, `upper`], then this
        metric's `value` needs to comply with the constraints
        `value <= lower` OR `upper <= value`.

        Exclusion bounds are a useful tool for enhancing the performance of a
        system. They can be used to restrict the acceptance of commands that fall
        below a certain threshold, which can help ensure the smooth functioning of
        the system.
        E.g., exclusion bounds can be set to limit the minimum charging power to a
        sufficiently high level, preventing a peak-shaver client from sending
        charge powers that are too low when a DC heater client is executing a
        charge pulse. This can significantly improve the overall performance of the
        DC heating mechanism.


        If multiple exclusion bounds have been provided bor a metric, then the
        aggregated lower and upper exclusion bounds are calculated as follows:
        lower: the minimum of all lower exclusion bounds
        upper: the maximum of all upper exclusion bounds

        It is important to note that these bounds work together with
        `system_inclusion_bounds`.

        E.g., for the system to accept a charge command,
        clients need to request power values within the bounds
        `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
        This means that clients can only request charge commands with values that
        are within the `system_inclusion_bounds`, but not within
        `system_exclusion_bounds`.
        Similarly, for the system to accept a discharge command,
        clients need to request power values within the bounds
        `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.

        The following diagram illustrates the relationship between the bounds.
        ```
        inclusion.lower                              inclusion.upper
        <-------|============|------------------|============|--------->
        exclusion.lower    exclusion.upper
        ```
        ---- values here are disallowed and wil be rejected
        ==== vales here are allowed and will be accepted
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddInclusionBounds(self, request, context):
        """Adds inclusion bounds for a given metric of a given component, and returns
        the UTC timestamp until which the given inclusion bounds will stay in
        effect.

        Inclusion bounds refer to the range of values that are allowed for the
        metric. If these bounds for a metric are [`lower`, `upper`], then this
        metric's `value` needs to comply with the constraint
        `lower <= value <= upper`.

        If multiple inclusion bounds have been provided bor a metric, then the
        aggregated lower and upper inclusion bounds are calculated as follows:
        lower: the maximum of all lower inclusion bounds
        upper: the minimum of all upper inclusion bounds

        It is important to note that these bounds work together with
        `system_exclusion_bounds`.

        E.g., for the system to accept a charge command,
        clients need to request power values within the bounds
        `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
        This means that clients can only request charge commands with values that
        are within the `system_inclusion_bounds`, but not within
        `system_exclusion_bounds`.
        Similarly, for the system to accept a discharge command,
        clients need to request power values within the bounds
        `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.

        The following diagram illustrates the relationship between the bounds.
        ```
        inclusion.lower                              inclusion.upper
        <-------|============|------------------|============|--------->
        exclusion.lower    exclusion.upper
        ```
        ---- values here are disallowed and wil be rejected
        ==== vales here are allowed and will be accepted
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetPowerActive(self, request, context):
        """Sets the active power output of a component with a given ID, provided the
        component supports it.

        Note that the target component may have a resolution of more than 1 W.
        E.g., an inverter may have a resolution of 88 W.
        In such cases, the magnitude of power will be floored to the nearest
        multiple of the resolution.

        Performs the following sequence actions for the following component
        categories:

        * Inverter: Sends the discharge command to the inverter, making it deliver
        AC power.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetPowerReactive(self, request, context):
        """Sets the reactive power output of a component with a given ID, provided the
        component supports it.

        Note that the target component may have a resolution of more than 1 VAr.
        E.g., an inverter may have a resolution of 88 VAr.
        In such cases, the magnitude of power will be floored to the nearest
        multiple of the resolution.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Start(self, request, context):
        """Starts the component, and brings it into a state where it is immediately
        operational.

        Performs the following sequence of actions for the following component
        categories:

        * Inverter:
        * closes DC relays, if the feature is available
        * closes AC relays
        * sets power output to 0

        * Battery: Checks if DC relays are open, then
        * closes DC relays

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.

        If a feature required to perform an action is missing, then that action is
        skipped.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def HotStandby(self, request, context):
        """Sets the given component into a hot-standby state, from which it can return
        into an operational state within at most 5 seconds.

        Performs the following sequence actions for the following component
        categories:

        * Inverter: Checks if AC and DC relays are closed, then
        * sets power to 0

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ColdStandby(self, request, context):
        """Sets the given component into a cold-standby state, from which it can
        return into an operational state within at most 2 minutes.

        Performs the following sequence actions for the following component
        categories:

        * Inverter: Checks if AC and DC relays are closed, then
        * sets power to 0, and
        * opens AC relays

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call efffectively skips that action.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Stop(self, request, context):
        """Stops the component completely, potentially disengaging its power
        electronics controller(s).

        Performs the following sequence actions for the following component
        categories:

        * Inverter:
        * Brings component to the cold-standby state
        * opens DC relays

        * Battery: Checks if the power output is 0, then
        * opens DC relays

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.

        If a feature required to perform an action is missing, then that action is
        skipped.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ErrorAck(self, request, context):
        """Acknowledges any recoverable error reported by the component, and brings it
        back to the stopped or cold-standby state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')
Functions¤
AddExclusionBounds(request, context) ¤

Adds exclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given exclusion bounds will stay in effect.

Exclusion bounds refer to the range of values that are disallowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraints value <= lower OR upper <= value.

Exclusion bounds are a useful tool for enhancing the performance of a system. They can be used to restrict the acceptance of commands that fall below a certain threshold, which can help ensure the smooth functioning of the system. E.g., exclusion bounds can be set to limit the minimum charging power to a sufficiently high level, preventing a peak-shaver client from sending charge powers that are too low when a DC heater client is executing a charge pulse. This can significantly improve the overall performance of the DC heating mechanism.

If multiple exclusion bounds have been provided bor a metric, then the aggregated lower and upper exclusion bounds are calculated as follows: lower: the minimum of all lower exclusion bounds upper: the maximum of all upper exclusion bounds

It is important to note that these bounds work together with system_inclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def AddExclusionBounds(self, request, context):
    """Adds exclusion bounds for a given metric of a given component, and returns
    the UTC timestamp until which the given exclusion bounds will stay in
    effect.

    Exclusion bounds refer to the range of values that are disallowed for the
    metric. If these bounds for a metric are [`lower`, `upper`], then this
    metric's `value` needs to comply with the constraints
    `value <= lower` OR `upper <= value`.

    Exclusion bounds are a useful tool for enhancing the performance of a
    system. They can be used to restrict the acceptance of commands that fall
    below a certain threshold, which can help ensure the smooth functioning of
    the system.
    E.g., exclusion bounds can be set to limit the minimum charging power to a
    sufficiently high level, preventing a peak-shaver client from sending
    charge powers that are too low when a DC heater client is executing a
    charge pulse. This can significantly improve the overall performance of the
    DC heating mechanism.


    If multiple exclusion bounds have been provided bor a metric, then the
    aggregated lower and upper exclusion bounds are calculated as follows:
    lower: the minimum of all lower exclusion bounds
    upper: the maximum of all upper exclusion bounds

    It is important to note that these bounds work together with
    `system_inclusion_bounds`.

    E.g., for the system to accept a charge command,
    clients need to request power values within the bounds
    `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
    This means that clients can only request charge commands with values that
    are within the `system_inclusion_bounds`, but not within
    `system_exclusion_bounds`.
    Similarly, for the system to accept a discharge command,
    clients need to request power values within the bounds
    `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.

    The following diagram illustrates the relationship between the bounds.
    ```
    inclusion.lower                              inclusion.upper
    <-------|============|------------------|============|--------->
    exclusion.lower    exclusion.upper
    ```
    ---- values here are disallowed and wil be rejected
    ==== vales here are allowed and will be accepted
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
AddInclusionBounds(request, context) ¤

Adds inclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given inclusion bounds will stay in effect.

Inclusion bounds refer to the range of values that are allowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraint lower <= value <= upper.

If multiple inclusion bounds have been provided bor a metric, then the aggregated lower and upper inclusion bounds are calculated as follows: lower: the maximum of all lower inclusion bounds upper: the minimum of all upper inclusion bounds

It is important to note that these bounds work together with system_exclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def AddInclusionBounds(self, request, context):
    """Adds inclusion bounds for a given metric of a given component, and returns
    the UTC timestamp until which the given inclusion bounds will stay in
    effect.

    Inclusion bounds refer to the range of values that are allowed for the
    metric. If these bounds for a metric are [`lower`, `upper`], then this
    metric's `value` needs to comply with the constraint
    `lower <= value <= upper`.

    If multiple inclusion bounds have been provided bor a metric, then the
    aggregated lower and upper inclusion bounds are calculated as follows:
    lower: the maximum of all lower inclusion bounds
    upper: the minimum of all upper inclusion bounds

    It is important to note that these bounds work together with
    `system_exclusion_bounds`.

    E.g., for the system to accept a charge command,
    clients need to request power values within the bounds
    `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
    This means that clients can only request charge commands with values that
    are within the `system_inclusion_bounds`, but not within
    `system_exclusion_bounds`.
    Similarly, for the system to accept a discharge command,
    clients need to request power values within the bounds
    `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.

    The following diagram illustrates the relationship between the bounds.
    ```
    inclusion.lower                              inclusion.upper
    <-------|============|------------------|============|--------->
    exclusion.lower    exclusion.upper
    ```
    ---- values here are disallowed and wil be rejected
    ==== vales here are allowed and will be accepted
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
CanStreamData(request, context) ¤

Returns whether the component with given ID can stream data.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def CanStreamData(self, request, context):
    """Returns whether the component with given ID can stream data.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
ColdStandby(request, context) ¤

Sets the given component into a cold-standby state, from which it can return into an operational state within at most 2 minutes.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0, and
  • opens AC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call efffectively skips that action.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def ColdStandby(self, request, context):
    """Sets the given component into a cold-standby state, from which it can
    return into an operational state within at most 2 minutes.

    Performs the following sequence actions for the following component
    categories:

    * Inverter: Checks if AC and DC relays are closed, then
    * sets power to 0, and
    * opens AC relays

    If any of the checks mentioned above fails, then the method call returns an
    error.

    If any of the above mentioned actions for a given component has already
    been performed, then this method call efffectively skips that action.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
ErrorAck(request, context) ¤

Acknowledges any recoverable error reported by the component, and brings it back to the stopped or cold-standby state.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def ErrorAck(self, request, context):
    """Acknowledges any recoverable error reported by the component, and brings it
    back to the stopped or cold-standby state.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
GetMicrogridMetadata(request, context) ¤

/ Returns the microgrid metadata / The metadata consists of information that describes the overall / microgrid, as opposed to its components, / e.g., the microgrid ID, location.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def GetMicrogridMetadata(self, request, context):
    """/ Returns the microgrid metadata
    / The metadata consists of information that describes the overall
    / microgrid, as opposed to its components,
    / e.g., the microgrid ID, location.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
HotStandby(request, context) ¤

Sets the given component into a hot-standby state, from which it can return into an operational state within at most 5 seconds.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def HotStandby(self, request, context):
    """Sets the given component into a hot-standby state, from which it can return
    into an operational state within at most 5 seconds.

    Performs the following sequence actions for the following component
    categories:

    * Inverter: Checks if AC and DC relays are closed, then
    * sets power to 0

    If any of the checks mentioned above fails, then the method call returns an
    error.

    If any of the above mentioned actions for a given component has already
    been performed, then this method call effectively skips that action.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
ListComponents(request, context) ¤

List components in the local microgrid, optionally filtered by a given list of component IDs and component categories.

If provided, the filters for component IDs and categories have an AND relationship with one another, meaning that they are applied serially, but the elements within a single filter list have an OR relationship with each other. E.g., if ids = [1, 2, 3], and categories = [ ComponentCategory::COMPONENT_CATEGORY_INVERTER, ComponentCategory::COMPONENT_CATEGORY_BATTERY], then the results will consist of elements that have the IDs 1, OR 2, OR 3, AND are of the categories ComponentCategory::COMPONENT_CATEGORY_INVERTER OR ComponentCategory::COMPONENT_CATEGORY_BATTERY.

If a filter list is empty, then that filter is not applied.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def ListComponents(self, request, context):
    """List components in the local microgrid, optionally filtered by a given list
    of component IDs and component categories.

    If provided, the filters for component IDs and categories have an `AND`
    relationship with one another, meaning that they are applied serially,
    but the elements within a single filter list have an `OR` relationship with
    each other.
    E.g., if `ids` = [1, 2, 3], and `categories` = [
    `ComponentCategory::COMPONENT_CATEGORY_INVERTER`,
    `ComponentCategory::COMPONENT_CATEGORY_BATTERY`],
    then the results will consist of elements that
    have the IDs 1, OR 2, OR 3,
    AND
    are of the categories `ComponentCategory::COMPONENT_CATEGORY_INVERTER` OR
    `ComponentCategory::COMPONENT_CATEGORY_BATTERY`.

    If a filter list is empty, then that filter is not applied.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
ListConnections(request, context) ¤

Returns a list of the connections between components as (start, end) pairs of connection IDs, where the direction of individual connections is always away from the grid endpoint, i.e. aligned with the direction of positive current according to the passive sign convention: https://en.wikipedia.org/wiki/Passive_sign_convention

The request may be filtered by start/end component(s) of individual connections. If provided, the start and end filters have an AND relationship between each other, meaning that they are applied serially, but an OR relationship with other elements in the same list. For example, if start = [1, 2, 3], and end = [4, 5, 6], then the result should have all the connections where * each start component ID is either 1, 2, OR 3, AND * each end component ID is either 4, 5, OR 6.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def ListConnections(self, request, context):
    """Returns a list of the connections between components as `(start, end)`
    pairs of connection IDs, where the direction of individual connections
    is always away from the grid endpoint, i.e. aligned with the direction
    of positive current according to the passive sign convention:
    https://en.wikipedia.org/wiki/Passive_sign_convention

    The request may be filtered by `start`/`end` component(s) of individual
    connections.  If provided, the `start` and `end` filters have an `AND`
    relationship between each other, meaning that they are applied serially,
    but an `OR` relationship with other elements in the same list.
    For example, if `start` = `[1, 2, 3]`, and `end` = `[4, 5, 6]`, then the
    result should have all the connections where
    * each `start` component ID is either `1`, `2`, OR `3`,
    AND
    * each `end` component ID is either `4`, `5`, OR `6`.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
SetPowerActive(request, context) ¤

Sets the active power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 W. E.g., an inverter may have a resolution of 88 W. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Performs the following sequence actions for the following component categories:

  • Inverter: Sends the discharge command to the inverter, making it deliver AC power.
Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def SetPowerActive(self, request, context):
    """Sets the active power output of a component with a given ID, provided the
    component supports it.

    Note that the target component may have a resolution of more than 1 W.
    E.g., an inverter may have a resolution of 88 W.
    In such cases, the magnitude of power will be floored to the nearest
    multiple of the resolution.

    Performs the following sequence actions for the following component
    categories:

    * Inverter: Sends the discharge command to the inverter, making it deliver
    AC power.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
SetPowerReactive(request, context) ¤

Sets the reactive power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 VAr. E.g., an inverter may have a resolution of 88 VAr. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def SetPowerReactive(self, request, context):
    """Sets the reactive power output of a component with a given ID, provided the
    component supports it.

    Note that the target component may have a resolution of more than 1 VAr.
    E.g., an inverter may have a resolution of 88 VAr.
    In such cases, the magnitude of power will be floored to the nearest
    multiple of the resolution.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
Start(request, context) ¤

Starts the component, and brings it into a state where it is immediately operational.

Performs the following sequence of actions for the following component categories:

  • Inverter:
  • closes DC relays, if the feature is available
  • closes AC relays
  • sets power output to 0

  • Battery: Checks if DC relays are open, then

  • closes DC relays

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def Start(self, request, context):
    """Starts the component, and brings it into a state where it is immediately
    operational.

    Performs the following sequence of actions for the following component
    categories:

    * Inverter:
    * closes DC relays, if the feature is available
    * closes AC relays
    * sets power output to 0

    * Battery: Checks if DC relays are open, then
    * closes DC relays

    If any of the above mentioned actions for a given component has already
    been performed, then this method call effectively skips that action.

    If a feature required to perform an action is missing, then that action is
    skipped.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
Stop(request, context) ¤

Stops the component completely, potentially disengaging its power electronics controller(s).

Performs the following sequence actions for the following component categories:

  • Inverter:
  • Brings component to the cold-standby state
  • opens DC relays

  • Battery: Checks if the power output is 0, then

  • opens DC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def Stop(self, request, context):
    """Stops the component completely, potentially disengaging its power
    electronics controller(s).

    Performs the following sequence actions for the following component
    categories:

    * Inverter:
    * Brings component to the cold-standby state
    * opens DC relays

    * Battery: Checks if the power output is 0, then
    * opens DC relays

    If any of the checks mentioned above fails, then the method call returns an
    error.

    If any of the above mentioned actions for a given component has already
    been performed, then this method call effectively skips that action.

    If a feature required to perform an action is missing, then that action is
    skipped.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
StreamComponentData(request, context) ¤

Returns a stream containing data from a component with a given ID.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def StreamComponentData(self, request, context):
    """Returns a stream containing data from a component with a given ID.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

frequenz.api.microgrid.microgrid_pb2_grpc.MicrogridStub ¤

Bases: object

Missing associated documentation comment in .proto file.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
class MicrogridStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.GetMicrogridMetadata = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString,
                _registered_method=True)
        self.ListComponents = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/ListComponents',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString,
                response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString,
                _registered_method=True)
        self.ListConnections = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/ListConnections',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString,
                response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString,
                _registered_method=True)
        self.StreamComponentData = channel.unary_stream(
                '/frequenz.api.microgrid.Microgrid/StreamComponentData',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString,
                _registered_method=True)
        self.CanStreamData = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/CanStreamData',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString,
                _registered_method=True)
        self.AddExclusionBounds = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/AddExclusionBounds',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
                _registered_method=True)
        self.AddInclusionBounds = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/AddInclusionBounds',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
                _registered_method=True)
        self.SetPowerActive = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/SetPowerActive',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.SetPowerReactive = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/SetPowerReactive',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.Start = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/Start',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.HotStandby = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/HotStandby',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.ColdStandby = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/ColdStandby',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.Stop = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/Stop',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.ErrorAck = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/ErrorAck',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
Attributes¤
AddExclusionBounds: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetBoundsParam, google.protobuf.timestamp_pb2.Timestamp] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/AddExclusionBounds', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString, _registered_method=True) instance-attribute ¤

Adds exclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given exclusion bounds will stay in effect.

Exclusion bounds refer to the range of values that are disallowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraints value <= lower OR upper <= value.

Exclusion bounds are a useful tool for enhancing the performance of a system. They can be used to restrict the acceptance of commands that fall below a certain threshold, which can help ensure the smooth functioning of the system. E.g., exclusion bounds can be set to limit the minimum charging power to a sufficiently high level, preventing a peak-shaver client from sending charge powers that are too low when a DC heater client is executing a charge pulse. This can significantly improve the overall performance of the DC heating mechanism.

If multiple exclusion bounds have been provided bor a metric, then the aggregated lower and upper exclusion bounds are calculated as follows: lower: the minimum of all lower exclusion bounds upper: the maximum of all upper exclusion bounds

It is important to note that these bounds work together with system_inclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

  inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
               exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

AddInclusionBounds: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetBoundsParam, google.protobuf.timestamp_pb2.Timestamp] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/AddInclusionBounds', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString, _registered_method=True) instance-attribute ¤

Adds inclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given inclusion bounds will stay in effect.

Inclusion bounds refer to the range of values that are allowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraint lower <= value <= upper.

If multiple inclusion bounds have been provided bor a metric, then the aggregated lower and upper inclusion bounds are calculated as follows: lower: the maximum of all lower inclusion bounds upper: the minimum of all upper inclusion bounds

It is important to note that these bounds work together with system_exclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

  inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
               exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

CanStreamData: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.wrappers_pb2.BoolValue] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/CanStreamData', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString, _registered_method=True) instance-attribute ¤

Returns whether the component with given ID can stream data.

ColdStandby: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/ColdStandby', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) instance-attribute ¤

Sets the given component into a cold-standby state, from which it can return into an operational state within at most 2 minutes.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0, and
  • opens AC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call efffectively skips that action.

ErrorAck: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/ErrorAck', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) instance-attribute ¤

Acknowledges any recoverable error reported by the component, and brings it back to the stopped or cold-standby state.

GetMicrogridMetadata: grpc.UnaryUnaryMultiCallable[google.protobuf.empty_pb2.Empty, frequenz.api.microgrid.microgrid_pb2.MicrogridMetadata] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString, _registered_method=True) instance-attribute ¤

/ Returns the microgrid metadata / The metadata consists of information that describes the overall / microgrid, as opposed to its components, / e.g., the microgrid ID, location.

HotStandby: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/HotStandby', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) instance-attribute ¤

Sets the given component into a hot-standby state, from which it can return into an operational state within at most 5 seconds.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

ListComponents: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentFilter, frequenz.api.microgrid.microgrid_pb2.ComponentList] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/ListComponents', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString, response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString, _registered_method=True) instance-attribute ¤

List components in the local microgrid, optionally filtered by a given list of component IDs and component categories.

If provided, the filters for component IDs and categories have an AND relationship with one another, meaning that they are applied serially, but the elements within a single filter list have an OR relationship with each other. E.g., if ids = [1, 2, 3], and categories = [ ComponentCategory::COMPONENT_CATEGORY_INVERTER, ComponentCategory::COMPONENT_CATEGORY_BATTERY], then the results will consist of elements that have the IDs 1, OR 2, OR 3, AND are of the categories ComponentCategory::COMPONENT_CATEGORY_INVERTER OR ComponentCategory::COMPONENT_CATEGORY_BATTERY.

If a filter list is empty, then that filter is not applied.

ListConnections: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ConnectionFilter, frequenz.api.microgrid.microgrid_pb2.ConnectionList] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/ListConnections', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString, response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString, _registered_method=True) instance-attribute ¤

Returns a list of the connections between components as (start, end) pairs of connection IDs, where the direction of individual connections is always away from the grid endpoint, i.e. aligned with the direction of positive current according to the passive sign convention: https://en.wikipedia.org/wiki/Passive_sign_convention

The request may be filtered by start/end component(s) of individual connections. If provided, the start and end filters have an AND relationship between each other, meaning that they are applied serially, but an OR relationship with other elements in the same list. For example, if start = [1, 2, 3], and end = [4, 5, 6], then the result should have all the connections where * each start component ID is either 1, 2, OR 3, AND * each end component ID is either 4, 5, OR 6.

SetPowerActive: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetPowerActiveParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/SetPowerActive', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) instance-attribute ¤

Sets the active power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 W. E.g., an inverter may have a resolution of 88 W. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Performs the following sequence actions for the following component categories:

  • Inverter: Sends the discharge command to the inverter, making it deliver AC power.
SetPowerReactive: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetPowerReactiveParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/SetPowerReactive', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) instance-attribute ¤

Sets the reactive power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 VAr. E.g., an inverter may have a resolution of 88 VAr. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Start: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/Start', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) instance-attribute ¤

Starts the component, and brings it into a state where it is immediately operational.

Performs the following sequence of actions for the following component categories:

  • Inverter:
  • closes DC relays, if the feature is available
  • closes AC relays
  • sets power output to 0

  • Battery: Checks if DC relays are open, then

  • closes DC relays

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

Stop: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/Stop', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) instance-attribute ¤

Stops the component completely, potentially disengaging its power electronics controller(s).

Performs the following sequence actions for the following component categories:

  • Inverter:
  • Brings component to the cold-standby state
  • opens DC relays

  • Battery: Checks if the power output is 0, then

  • opens DC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

StreamComponentData: grpc.UnaryStreamMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, frequenz.api.microgrid.microgrid_pb2.ComponentData] = channel.unary_stream('/frequenz.api.microgrid.Microgrid/StreamComponentData', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString, _registered_method=True) instance-attribute ¤

Returns a stream containing data from a component with a given ID.

Functions¤
__init__(channel) ¤

Constructor.

PARAMETER DESCRIPTION
channel

A grpc.Channel.

TYPE: Union[Channel, Channel]

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def __init__(self, channel):
    """Constructor.

    Args:
        channel: A grpc.Channel.
    """
    self.GetMicrogridMetadata = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata',
            request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString,
            _registered_method=True)
    self.ListComponents = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/ListComponents',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString,
            response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString,
            _registered_method=True)
    self.ListConnections = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/ListConnections',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString,
            response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString,
            _registered_method=True)
    self.StreamComponentData = channel.unary_stream(
            '/frequenz.api.microgrid.Microgrid/StreamComponentData',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString,
            _registered_method=True)
    self.CanStreamData = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/CanStreamData',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString,
            _registered_method=True)
    self.AddExclusionBounds = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/AddExclusionBounds',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            _registered_method=True)
    self.AddInclusionBounds = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/AddInclusionBounds',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            _registered_method=True)
    self.SetPowerActive = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/SetPowerActive',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            _registered_method=True)
    self.SetPowerReactive = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/SetPowerReactive',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            _registered_method=True)
    self.Start = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/Start',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            _registered_method=True)
    self.HotStandby = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/HotStandby',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            _registered_method=True)
    self.ColdStandby = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/ColdStandby',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            _registered_method=True)
    self.Stop = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/Stop',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            _registered_method=True)
    self.ErrorAck = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/ErrorAck',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            _registered_method=True)